X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=util%2Fyaz-url.c;h=ed5d8bb10c95e27db41415786b537c85d26108d3;hp=cf9974f5009c1cee7c47eab686331dc3851c092e;hb=f0a90ff91f426a5d1ce96bdf5f61d18cf37e5fb7;hpb=77c5a4fca8b516fd39b8ba213daed17a465a6b2a diff --git a/util/yaz-url.c b/util/yaz-url.c index cf9974f..ed5d8bb 100644 --- a/util/yaz-url.c +++ b/util/yaz-url.c @@ -4,7 +4,7 @@ */ #if HAVE_CONFIG_H -#include "config.h" +#include #endif #include @@ -45,7 +45,12 @@ static char *get_file(const char *fname, size_t *len) { buf = xmalloc(*len); fseek(inf, 0L, SEEK_SET); - (void) fread(buf, 1, *len, inf); + size_t r = fread(buf, 1, *len, inf); + if (r != *len) + { + yaz_log(YLOG_FATAL|YLOG_ERRNO, "short fread of %s", fname); + exit(1); + } } fclose(inf); return buf;