Fix bad count (missing nul) in stack-allocated char array

This commit is contained in:
K. Lange 2018-03-01 23:17:45 +09:00 committed by Kevin Lange
parent 5ace6fce2a
commit e198b36d60
1 changed files with 1 additions and 1 deletions

2
ls.c
View File

@ -322,7 +322,7 @@ static int display_dir(char * p) {
f->name = strdup(ent->d_name);
char tmp[strlen(p)+strlen(ent->d_name)+1];
char tmp[strlen(p)+strlen(ent->d_name)+2];
sprintf(tmp, "%s/%s", p, ent->d_name);
int t = lstat(tmp, &f->statbuf);
if (S_ISLNK(f->statbuf.st_mode)) {