don't use fgets() as MSVC does not implement it. use fgetc instead.
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 10 Sep 2005 18:46:03 +0000 (18:46 +0000)
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 10 Sep 2005 18:46:03 +0000 (18:46 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15750 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dtd_preparse.l

index 101a9161a462965681dd7729b68da2d38ece6faf..7b6fa6792e5e98103b674d5635e7ba1a9355ba65 100644 (file)
@@ -139,8 +139,7 @@ static gchar* load_entity_file(gchar* fname) {
        FILE* fp = fopen(fullname,"r");
        GString* filetext;
        gchar* retstr;
-       gchar* line;
-       size_t linelen;
+       gchar c;
        
        g_free(fullname);
        
@@ -154,10 +153,12 @@ static gchar* load_entity_file(gchar* fname) {
        
        filetext = g_string_new(location());
        
-       while(( line = fgetln(fp,&linelen) )) {
-               g_string_append(filetext,location());
-               g_string_append_len(filetext,line,linelen);
-               linenum++;
+       while(( c = fgetc(fp) )) {
+               g_string_append_c(filetext,c);
+               if(c == '\n') {
+                       g_string_append(filetext,location());
+                       linenum++;
+               }
        }
 
        retstr = filetext->str;