mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
Fix fread error handling.
This commit is contained in:
parent
2aeec1a18c
commit
1f337f292d
@ -138,6 +138,7 @@ read_providers(const char *fname,
|
|||||||
if (fread(providersd, 1, fsize, providersf) != fsize) {
|
if (fread(providersd, 1, fsize, providersf) != fsize) {
|
||||||
fclose(providersf);
|
fclose(providersf);
|
||||||
free(providersd);
|
free(providersd);
|
||||||
|
return NSERROR_BAD_SIZE;
|
||||||
}
|
}
|
||||||
providersd[fsize] = 0; /* ensure null terminated */
|
providersd[fsize] = 0; /* ensure null terminated */
|
||||||
|
|
||||||
|
@ -75,7 +75,9 @@ typedef enum {
|
|||||||
|
|
||||||
NSERROR_PERMISSION, /**< Permission error */
|
NSERROR_PERMISSION, /**< Permission error */
|
||||||
|
|
||||||
NSERROR_NOSPACE /**< Insufficient space */
|
NSERROR_NOSPACE, /**< Insufficient space */
|
||||||
|
|
||||||
|
NSERROR_BAD_SIZE /**< Bad size */
|
||||||
} nserror;
|
} nserror;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user