From 446687d63d46be6314e8a2065567e208e5345974 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Mon, 11 Feb 2013 15:03:41 +0000 Subject: [PATCH] efl/edbus: Make sure to compare EOF against an int from fgetc. Fgetc() return an int to clearly detect EOF. If you want to read more about it: http://stackoverflow.com/questions/11057259/fgetc-checking-eof SVN revision: 83829 --- src/bin/edbus/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/edbus/utils.c b/src/bin/edbus/utils.c index 02e7fb033b..47d8c77c19 100644 --- a/src/bin/edbus/utils.c +++ b/src/bin/edbus/utils.c @@ -5,7 +5,7 @@ Eina_Bool file_read(const char *file_name, char **buffer) { FILE *xml_handler; - char data; + int data; /* fgetc needs int to detect EOF correctly */ Eina_Strbuf *buf; xml_handler = fopen(file_name, "rt"); @@ -17,7 +17,7 @@ file_read(const char *file_name, char **buffer) buf = eina_strbuf_new(); while ((data = fgetc(xml_handler)) != EOF) - eina_strbuf_append_char(buf, data); + eina_strbuf_append_char(buf, (char)data); fclose(xml_handler); *buffer = eina_strbuf_string_steal(buf);