diff options
Diffstat (limited to 'twin/compton-tde/compton.c')
-rw-r--r-- | twin/compton-tde/compton.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c index 3f9b65e69..36af91f5b 100644 --- a/twin/compton-tde/compton.c +++ b/twin/compton-tde/compton.c @@ -110,7 +110,7 @@ void write_pid_file(pid_t pid) char uidstr[sizeof(uid_t)*8+1]; sprintf(uidstr, "%d", getuid()); int n = strlen(P_tmpdir)+strlen(uidstr)+strlen(pidfile)+3; - filename = (char*)malloc(n*sizeof(char)); + filename = (char*)malloc(n*sizeof(char)+1); memset(filename,0,n); strcat(filename, P_tmpdir); strcat(filename, "/."); @@ -141,7 +141,7 @@ void delete_pid_file() char uidstr[sizeof(uid_t)*8+1]; sprintf(uidstr, "%d", getuid()); int n = strlen(P_tmpdir)+strlen(uidstr)+strlen(pidfile)+3; - filename = (char*)malloc(n*sizeof(char)); + filename = (char*)malloc(n*sizeof(char)+1); memset(filename,0,n); strcat(filename, P_tmpdir); strcat(filename, "/."); |