spiffs: test: check for truncation in snprintf call

This commit is contained in:
Ivan Grokhotkov 2018-08-28 12:23:27 +08:00
parent 9ba5896d86
commit 324004f7b3

View File

@ -291,7 +291,8 @@ void test_spiffs_readdir_many_files(const char* dir_prefix)
if (!de) {
break;
}
snprintf(file_name, sizeof(file_name), "%s/%s", dir_prefix, de->d_name);
int len = snprintf(file_name, sizeof(file_name), "%s/%s", dir_prefix, de->d_name);
assert(len < sizeof(file_name));
unlink(file_name);
}
}