Skip to content

Commit

Permalink
Don't call memcmp() on an empty lastdir.
Browse files Browse the repository at this point in the history
  • Loading branch information
WayneD committed Jan 9, 2023
1 parent 5c93ded commit 90df93e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flist.c
Original file line number Diff line number Diff line change
Expand Up @@ -2367,7 +2367,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
}

dirlen = dir ? strlen(dir) : 0;
if (dirlen != lastdir_len || memcmp(lastdir, dir, dirlen) != 0) {
if (dirlen != lastdir_len || (dirlen && memcmp(lastdir, dir, dirlen) != 0)) {
if (!change_pathname(NULL, dir, -dirlen))
goto bad_path;
lastdir = pathname;
Expand Down

0 comments on commit 90df93e

Please sign in to comment.