mirror of git://git.suckless.org/ubase
Bail out on path truncation
This commit is contained in:
parent
b5c3bcda7d
commit
941ffd2aed
|
@ -36,8 +36,10 @@ delete_content(const char *dir, dev_t curdevice)
|
|||
continue;
|
||||
|
||||
/* build path and dive deeper */
|
||||
strlcat(path, dir, sizeof(path));
|
||||
strlcat(path, dent->d_name, sizeof(path));
|
||||
if (strlcat(path, dir, sizeof(path)) >= sizeof(path))
|
||||
eprintf("path too long\n");
|
||||
if (strlcat(path, dent->d_name, sizeof(path)) >= sizeof(path))
|
||||
eprintf("path too long\n");
|
||||
|
||||
delete_content(path, curdevice);
|
||||
path[0] = 0;
|
||||
|
|
Loading…
Reference in New Issue