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
This commit is contained in:
Stefan Schmidt 2013-02-11 15:03:41 +00:00
parent 62a20b6e95
commit 446687d63d
1 changed files with 2 additions and 2 deletions

View File

@ -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);