diff --git a/switch_root.c b/switch_root.c index 49a49e7..7500f8f 100644 --- a/switch_root.c +++ b/switch_root.c @@ -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;