skip over padding bytes in deps in /proc/modules

This commit is contained in:
K. Lange 2018-08-27 11:21:58 +09:00
parent cdccc913ab
commit 036096d9c9

View File

@ -522,7 +522,10 @@ static uint32_t modules_func(fs_node_t *node, uint32_t offset, uint32_t size, ui
unsigned int i = 0;
soffset += sprintf(&buf[soffset], " Deps: ");
while (i < mod_info->deps_length) {
soffset += sprintf(&buf[soffset], "%s ", &mod_info->deps[i]);
/* Skip padding bytes */
if (strlen(&mod_info->deps[i])) {
soffset += sprintf(&buf[soffset], "%s ", &mod_info->deps[i]);
}
i += strlen(&mod_info->deps[i]) + 1;
}
}