aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-11-01 17:08:56 +0100
committerBruce Hill <bruce@bruce-hill.com>2019-11-01 17:08:56 +0100
commita97ea1d19bf5764b4177c4a3e2ce74b244cb69ec (patch)
treee221d4f90add38aa6b9ed850a9f4b6b541c40ed1
parent1ae460a02b5534d7fe16ede453bea260dcef8e29 (diff)
Fix for improperly initialized variable.
-rw-r--r--bb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bb.c b/bb.c
index 329b31c..d71d595 100644
--- a/bb.c
+++ b/bb.c
@@ -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';