diff options
-rw-r--r-- | src/config.c | 4 | ||||
-rw-r--r-- | src/note.c | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c index da6b049..5eb526a 100644 --- a/src/config.c +++ b/src/config.c @@ -600,8 +600,8 @@ unsigned config_save(void) return 1; strncpy(tmppath, get_tempdir(), BUFSIZ); - strncat(tmppath, "/" CONF_PATH_NAME ".", - BUFSIZ - strlen(tmppath) - 1); + tmppath[BUFSIZ - 1] = '\0'; + strncat(tmppath, "/" CONF_PATH_NAME ".", BUFSIZ - strlen(tmppath) - 1); if ((tmpext = new_tempfile(tmppath, TMPEXTSIZ)) == NULL) return 0; strncat(tmppath, tmpext, BUFSIZ - strlen(tmppath) - 1); @@ -83,6 +83,7 @@ void edit_note(char **note, const char *editor) FILE *fp; strncpy(tmppath, get_tempdir(), BUFSIZ); + tmppath[BUFSIZ - 1] = '\0'; strncat(tmppath, "/calcurse-note.", BUFSIZ - strlen(tmppath) - 1); if ((tmpext = new_tempfile(tmppath, TMPEXTSIZ)) == NULL) return; |