diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-11-01 17:08:56 +0100 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-11-01 17:08:56 +0100 |
| commit | a97ea1d19bf5764b4177c4a3e2ce74b244cb69ec (patch) | |
| tree | e221d4f90add38aa6b9ed850a9f4b6b541c40ed1 | |
| parent | 1ae460a02b5534d7fe16ede453bea260dcef8e29 (diff) | |
Fix for improperly initialized variable.
| -rw-r--r-- | bb.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -299,7 +299,7 @@ entry_t* load_entry(bb_t *bb, const char *path, int clear_dots) struct stat linkedstat, filestat; if (!path || !path[0]) return NULL; if (lstat(path, &filestat) == -1) return NULL; - char pbuf[PATH_MAX]; + char pbuf[PATH_MAX] = {0}; char *slash = strrchr(path, '/'); if (slash) { strncpy(pbuf, path, (slash - path)); @@ -405,7 +405,7 @@ int populate_files(bb_t *bb, const char *path) char old_selected[PATH_MAX] = ""; if (samedir && bb->nfiles > 0) strcpy(old_selected, bb->files[bb->cursor]->fullname); - char pbuf[PATH_MAX], prev[PATH_MAX] = {0}; + char pbuf[PATH_MAX] = {0}, prev[PATH_MAX] = {0}; strcpy(prev, bb->path); if (path == NULL) { pbuf[0] = '\0'; |
