CVS: setedit/doc sdh.c,1.9,1.10
Brought to you by:
set
From: Salvador E. T. <se...@us...> - 2015-06-03 14:20:15
|
Update of /cvsroot/setedit/setedit/doc In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23822/doc Modified Files: sdh.c Log Message: * Fixed: [gcc] Warnings about write, fgets, chdir and getcwd ignored return values. * Fixed: [gcc] Warning about memset called with 0 size. * Fixed: [gcc] Warnings about *printf when fputs is enough. Index: sdh.c =================================================================== RCS file: /cvsroot/setedit/setedit/doc/sdh.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sdh.c 13 Aug 2004 19:01:52 -0000 1.9 --- sdh.c 3 Jun 2015 14:20:12 -0000 1.10 *************** *** 1,5 **** /***************************************************************************** ! SET's Documentation Helper (SDH) Copyright(c) 1997-2004 by Salvador Eduardo Tropea --- 1,5 ---- /***************************************************************************** ! SET's Documentation Helper (SDH) Copyright(c) 1997-2015 by Salvador Eduardo Tropea *************** *** 395,401 **** } ! void ReadLine(void) { ! fgets(bl,MAX_BL,fi); } --- 395,401 ---- } ! char *ReadLine(void) { ! return fgets(bl,MAX_BL,fi); } *************** *** 1030,1034 **** while (*bl!=31 && !feof(f)) { ! fgets(bl,MAX_BL,f); } if (feof(f)) --- 1030,1035 ---- while (*bl!=31 && !feof(f)) { ! if (fgets(bl,MAX_BL,f)==NULL) ! break; } if (feof(f)) *************** *** 1036,1040 **** do { ! fgets(bl,MAX_BL,f); } while (ucisspace(*bl) && !feof(f)); --- 1037,1042 ---- do { ! if (fgets(bl,MAX_BL,f)==NULL) ! break; } while (ucisspace(*bl) && !feof(f)); *************** *** 1083,1087 **** do { ! fgets(bl,MAX_BL,f); if (*bl=='*' && *(bl+1)!='*' && strncmp(bl,"* Menu:",7)!=0) break; --- 1085,1090 ---- do { ! if (fgets(bl,MAX_BL,f)==NULL) ! break; if (*bl=='*' && *(bl+1)!='*' && strncmp(bl,"* Menu:",7)!=0) break; *************** *** 1091,1095 **** { Convert(bl,o); ! fgets(bl,MAX_BL,f); if (*bl!='*') break; --- 1094,1099 ---- { Convert(bl,o); ! if (fgets(bl,MAX_BL,f)==NULL) ! break; if (*bl!='*') break; *************** *** 1364,1381 **** if (OutPathOrig) { ! getcwd(path,PATH_MAX); ! chdir(OutPathOrig); } sprintf(s,"tex %s",inf); puts(s); ! system(s); puts(s); sprintf(s,"texindex %s.??",inf); ! system(s); puts(s); sprintf(s,"tex %s",inf); ! system(s); ! if (OutPathOrig) ! chdir(path); } --- 1368,1393 ---- if (OutPathOrig) { ! if (getcwd(path,PATH_MAX)==NULL) ! error=-1; ! if (chdir(OutPathOrig)==-1) ! error=-1; } sprintf(s,"tex %s",inf); puts(s); ! if (system(s)==-1) ! printf("Failed executing:\n%s\n",s); puts(s); sprintf(s,"texindex %s.??",inf); ! if (system(s)==-1) ! printf("Failed executing:\n%s\n",s); puts(s); sprintf(s,"tex %s",inf); ! if (system(s)==-1) ! printf("Failed executing:\n%s\n",s); ! if (OutPathOrig && error!=-1) ! { ! if (chdir(path)==-1) ! printf("Failed to go back to dir: %s\n",path); ! } } |