home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.sources
- Path: sparky!uunet!psinntp!sugar!peter
- From: peter@NeoSoft.com (Peter da Silva)
- Subject: PATCH 921222 for PPS
- Organization: NeoSoft Communications Services -- (713) 684-5900
- Date: Tue, 22 Dec 1992 09:14:10 GMT
- Message-ID: <BznLno.B5q@NeoSoft.com>
- Lines: 106
-
- Archive-name: pps.921222.patch
-
- Three bugs, two caught by GCC, one caught by an observant user.
-
- Preps is obviously not one of my more recent programs: I don't use file
- pointers as flags any more. Added "gotfile" flag to main.
-
- Bad argument "fp" to perror. Fixed.
-
- Bad argument "newstyle" to printf. Fixed and added "%s" just for safety.
-
- *** orig/preps.c Tue Dec 22 03:04:03 1992
- --- preps.c Tue Dec 22 03:03:44 1992
- ***************
- *** 33,38 ****
- --- 33,39 ----
- char **av;
- {
- FILE *fp;
- + int gotfile;
- static char buffer[MAXBUFFER];
- char *t, *ctime();
- struct stat sb;
- ***************
- *** 43,48 ****
- --- 44,50 ----
- else
- prog = *av;
-
- + gotfile = 0;
- while(*++av) {
- option = 0;
- if(**av == '-') {
- ***************
- *** 89,95 ****
- }
- }
- } else if(!(fp = fopen(*av, "r"))) {
- ! perror(fp);
- exit(1);
- } else {
- if(fstat(fileno(fp), &sb) == 0) {
- --- 91,97 ----
- }
- }
- } else if(!(fp = fopen(*av, "r"))) {
- ! perror(*av);
- exit(1);
- } else {
- if(fstat(fileno(fp), &sb) == 0) {
- ***************
- *** 111,117 ****
- if(!filter) printf("EOF\n");
- }
- }
- ! if(!fp) {
- printf("/FILEDATE DATE def\n");
- printf("/DATEFONT ITALIC def\n");
- printf("/FILENAME TITLE def\n", *av);
- --- 113,119 ----
- if(!filter) printf("EOF\n");
- }
- }
- ! if(!gotfile) {
- printf("/FILEDATE DATE def\n");
- printf("/DATEFONT ITALIC def\n");
- printf("/FILENAME TITLE def\n", *av);
- ***************
- *** 261,267 ****
- }
- if(oldstyle != newstyle) {
- if(intext) endtext();
- ! printf(stylename[newstyle]);
- begintext();
- intext = 1;
- oldstyle = newstyle;
- --- 263,269 ----
- }
- if(oldstyle != newstyle) {
- if(intext) endtext();
- ! printf("%s", stylename[newstyle]);
- begintext();
- intext = 1;
- oldstyle = newstyle;
- ***************
- *** 282,288 ****
- intext = 0;
- }
- if(oldstyle != newstyle) {
- ! printf(newstyle);
- oldstyle = newstyle;
- }
- printos(col);
- --- 284,290 ----
- intext = 0;
- }
- if(oldstyle != newstyle) {
- ! printf("%s", stylename[newstyle]);
- oldstyle = newstyle;
- }
- printos(col);
- --
- Peter da Silva. <peter@sugar.neosoft.com>.
- `-_-' Oletko halannut suttasi táΣnáΣáΣn?
- 'U`
- Tarjoilija, táΣmáΣ ateria eláΣáΣ vieláΣ.
-