From a97ea1d19bf5764b4177c4a3e2ce74b244cb69ec Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 1 Nov 2019 17:08:56 +0100 Subject: Fix for improperly initialized variable. --- bb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bb.c') 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'; -- cgit v1.2.3