Module: kamailio
Branch: master
Commit: 28c44bad0d04cbf5c235f291f3068f58b7d81d07
URL:
https://github.com/kamailio/kamailio/commit/28c44bad0d04cbf5c235f291f3068f5…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2016-05-12T18:28:20+02:00
Merge pull request #616 from linuxmaniac/vseva/fix_build_warnings
corex: fix compiler warning #612
---
Modified: modules/corex/corex_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/28c44bad0d04cbf5c235f291f3068f5…
Patch:
https://github.com/kamailio/kamailio/commit/28c44bad0d04cbf5c235f291f3068f5…
---
diff --git a/modules/corex/corex_mod.c b/modules/corex/corex_mod.c
index b8b047f..3c87f21 100644
--- a/modules/corex/corex_mod.c
+++ b/modules/corex/corex_mod.c
@@ -349,7 +349,12 @@ static int w_file_read(sip_msg_t *msg, char *fn, char *vn)
fclose(f);
return -1;
}
- fread(content, fsize, 1, f);
+ if(fread(content, fsize, 1, f) != fsize) {
+ if(ferror(f)) {
+ LM_ERR("error reading from file: %.*s\n",
+ fname.len, fname.s);
+ }
+ }
fclose(f);
content[fsize] = 0;