The lack of result checking of fscanf function, breaks compilation
for default "-Werror=unused-result" flag.
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
{
char mod_name[30]; /* Any module names can be longer than 30 bytes? */
int ret = 0;
+ int n;
if (NULL == module_name)
return -1;
return -1;
}
while (!feof(fd)) {
- fscanf(fd, "%29s %*[^\n]", mod_name);
- if (!strcmp(mod_name, module_name)) {
+ n = fscanf(fd, "%29s %*[^\n]", mod_name);
+ if ((n == 1) && !strcmp(mod_name, module_name)) {
ret = 1;
break;
}