diff gui/skin/font.c @ 34560:abcf26dcec6b

Add fgetstr() to read from files without end-of-line characters. Use it where fgets'ed lines are cleared of EOLs. Remove gfgets() and replace these calls by fgetstr().
author ib
date Fri, 03 Feb 2012 13:38:42 +0000
parents d99f341d8442
children 948bec0f8df3
line wrap: on
line diff
--- a/gui/skin/font.c	Thu Feb 02 18:26:17 2012 +0000
+++ b/gui/skin/font.c	Fri Feb 03 13:38:42 2012 +0000
@@ -125,8 +125,7 @@
         return -3;
     }
 
-    while (fgets(buf, sizeof(buf), f)) {
-        buf[strcspn(buf, "\n\r")] = 0; // remove any kind of newline, if any
+    while (fgetstr(buf, sizeof(buf), f)) {
         strswap(buf, '\t', ' ');
         trim(buf);
         decomment(buf);