From: Enlightenment S. <no-...@en...> - 2009-03-03 06:49:02
|
Log: * use binary flag in fopen * fix warning Author: caro Date: 2009-03-02 22:48:56 -0800 (Mon, 02 Mar 2009) New Revision: 39342 Modified: trunk/TMP/st/elementary/src/lib/elc_notepad.c Modified: trunk/TMP/st/elementary/src/lib/elc_notepad.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elc_notepad.c 2009-03-03 06:07:08 UTC (rev 39341) +++ trunk/TMP/st/elementary/src/lib/elc_notepad.c 2009-03-03 06:48:56 UTC (rev 39342) @@ -78,9 +78,9 @@ int alloc = 0, len = 0, pos; char *text = NULL, buf[4096]; - f = fopen(file, "r"); + f = fopen(file, "rb"); if (!f) return NULL; - while (size = fread(buf, 1, sizeof(buf), f)) + while ((size = fread(buf, 1, sizeof(buf), f))) { buf[size] = 0; text = _buf_append(text, buf, &len, &alloc); @@ -146,7 +146,7 @@ ecore_file_unlink(file); return; } - f = fopen(file, "w"); + f = fopen(file, "wb"); if (!f) { // FIXME: report a write error |