mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-22 09:40:40 +02:00
nouveau: honor fread return value in the nouveau_compiler
There is little point of continuing if fread returns zero, as it indicates that either the file is empty or cannot be read from. Bail out if fread returns zero after closing the file. Cc: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
parent
ae7d236172
commit
ad4a44ebfc
1 changed files with 2 additions and 2 deletions
|
|
@ -173,9 +173,9 @@ main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
fread(text, 1, sizeof(text), f);
|
||||
if (ferror(f)) {
|
||||
if (!fread(text, 1, sizeof(text), f) || ferror(f)) {
|
||||
_debug_printf("Error reading file '%s'\n", filename);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
fclose(f);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue