diff options
author | lego <lego@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-09-10 18:46:03 +0000 |
---|---|---|
committer | lego <lego@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-09-10 18:46:03 +0000 |
commit | e71a45fb8b041e647625f0d734738dd69cbae02d (patch) | |
tree | 4a1089482e07d3af4fa00bed4bad977c7e9fb20f /epan/dtd_preparse.l | |
parent | 2e64abecd9f2b25c67474ebed2646340339c48ff (diff) |
don't use fgets() as MSVC does not implement it. use fgetc instead.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15750 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dtd_preparse.l')
-rw-r--r-- | epan/dtd_preparse.l | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/epan/dtd_preparse.l b/epan/dtd_preparse.l index 101a9161a4..7b6fa6792e 100644 --- a/epan/dtd_preparse.l +++ b/epan/dtd_preparse.l @@ -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; |