From: borutr Date: Fri, 26 Dec 2008 23:03:42 +0000 (+0000) Subject: * support/librarian/sdcclib.c: X-Git-Url: https://git.gag.com/?p=fw%2Fsdcc;a=commitdiff_plain;h=2f00ce617b44fd09d815a65d3489ed49fb8f65db * support/librarian/sdcclib.c: fixed bug 2466950: "sdcclib broken" by removing fgets return value check git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5302 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 56ad49ca..ef1b9c21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-26 Borut Razem + + * support/librarian/sdcclib.c: + fixed bug 2466950: "sdcclib broken" + by removing fgets return value check + 2008-12-26 Philipp Klaus Krause * src/z80/main.c, src/z80/gen.c, diff --git a/support/librarian/sdcclib.c b/support/librarian/sdcclib.c index 48e13e8b..5ab4c4a5 100644 --- a/support/librarian/sdcclib.c +++ b/support/librarian/sdcclib.c @@ -51,12 +51,6 @@ int NumRelFiles=0; #if 1 #include -#define fgets(S, SIZE, STREAM) do { \ - char *__s4567 = S; \ - char *__res4567 = fgets(__s4567, SIZE, STREAM); \ - assert(__s4567 == __res4567); \ -} while (0) - #define system(CMD) do { \ int __res4568 = system(CMD); \ assert(-1 != __res4568); \ @@ -317,7 +311,7 @@ void AddRel(char * RelName) fprintf(libindex, "\n%s %ld\n", FLine, newlibpos); state++; } - } + } break; case 1: fprintf(newlib, "%s\n", FLine); @@ -365,7 +359,7 @@ void AddRel(char * RelName) fclose(rel); fprintf(libindex, "\n"); fprintf(newlib, "\n\n"); - + adb=fopen(AdbName, "r"); if(adb!=NULL) { @@ -482,7 +476,7 @@ void ExtractRel(char * RelName) fgets(FLine, MAXLINE, lib); CleanLine(FLine); if(EQ(FLine, ModName)) state=1; - } + } break; case 1: if(EQ(FLine, "")) state=2; @@ -501,10 +495,10 @@ void ExtractRel(char * RelName) state=5; else fprintf(adb, "%s\n", FLine); - break; + break; } } - + fclose(rel); fclose(lib); fclose(adb); @@ -526,10 +520,10 @@ void DumpSymbols(void) CleanLine(FLine); if(NEQ(FLine, "")) { - printf("ERROR: File '%s' was not created with '%s'\n", LibName, ProgName); + printf("ERROR: File '%s' was not created with '%s'\n", LibName, ProgName); return; } - + while(!feof(lib)) { if(state==3) break; @@ -574,14 +568,14 @@ void DumpSymbols(void) break; } } - + fclose(lib); } int fileexist(char * fname) { FILE * fp; - + fp=fopen(fname, "r"); if(fp==NULL) return 0; fclose(fp); @@ -675,7 +669,7 @@ int main(int argc, char **argv) for(j=0; j