aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/textadept.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/textadept.c b/src/textadept.c
index 72e8af67..52b25974 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -2238,7 +2238,8 @@ int main(int argc, char **argv) {
char *last_slash = NULL;
#if __linux__
textadept_home = malloc(FILENAME_MAX);
- int _ = readlink("/proc/self/exe", textadept_home, FILENAME_MAX);
+ int len = readlink("/proc/self/exe", textadept_home, FILENAME_MAX);
+ textadept_home[len] = '\0';
if ((last_slash = strrchr(textadept_home, '/'))) *last_slash = '\0';
#elif _WIN32
textadept_home = malloc(FILENAME_MAX);