aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-29 13:05:03 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-02 10:34:47 +0100
commitd7f43c6018b3f8be3053281c279681278fe269f1 (patch)
tree7b85411a77bcdadf8c3a3c567af38e21f19fc8b6 /src/examples
parentexamples: fix ecore_fd_handler_gnutls_examples (diff)
downloadefl-d7f43c6018b3f8be3053281c279681278fe269f1.tar.gz
examples: fix eina_simple_xml_parser
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/eina/eina_simple_xml_parser_01.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/examples/eina/eina_simple_xml_parser_01.c b/src/examples/eina/eina_simple_xml_parser_01.c
index 0ad4ec3b85..824537c3b2 100644
--- a/src/examples/eina/eina_simple_xml_parser_01.c
+++ b/src/examples/eina/eina_simple_xml_parser_01.c
@@ -29,9 +29,15 @@ main(void)
size = ftell(file);
fseek(file, 0, SEEK_SET);
+ if (size < 0)
+ {
+ EINA_LOG_ERR("Can't read chat.xml");
+ return 0;
+ }
+
if ((buffer = malloc(size)))
{
- if (fread(buffer, 1, size, file) != size)
+ if (fread(buffer, 1, size, file) != (unsigned long)size)
{
EINA_LOG_ERR("Can't read chat.xml");
}