home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / alt / sources / 2843 < prev    next >
Encoding:
Text File  |  1992-12-22  |  2.6 KB  |  116 lines

  1. Newsgroups: alt.sources
  2. Path: sparky!uunet!psinntp!sugar!peter
  3. From: peter@NeoSoft.com (Peter da Silva)
  4. Subject: PATCH 921222 for PPS
  5. Organization: NeoSoft Communications Services -- (713) 684-5900
  6. Date: Tue, 22 Dec 1992 09:14:10 GMT
  7. Message-ID: <BznLno.B5q@NeoSoft.com>
  8. Lines: 106
  9.  
  10. Archive-name: pps.921222.patch
  11.  
  12. Three bugs, two caught by GCC, one caught by an observant user.
  13.  
  14. Preps is obviously not one of my more recent programs: I don't use file
  15. pointers as flags any more. Added "gotfile" flag to main.
  16.  
  17. Bad argument "fp" to perror. Fixed.
  18.  
  19. Bad argument "newstyle" to printf. Fixed and added "%s" just for safety.
  20.  
  21. *** orig/preps.c    Tue Dec 22 03:04:03 1992
  22. --- preps.c    Tue Dec 22 03:03:44 1992
  23. ***************
  24. *** 33,38 ****
  25. --- 33,39 ----
  26.   char **av;
  27.   {
  28.       FILE *fp;
  29. +     int gotfile;
  30.       static char buffer[MAXBUFFER];
  31.       char *t, *ctime();
  32.       struct stat sb;
  33. ***************
  34. *** 43,48 ****
  35. --- 44,50 ----
  36.       else
  37.           prog = *av;
  38.   
  39. +     gotfile = 0;
  40.       while(*++av) {
  41.           option = 0;
  42.           if(**av == '-') {
  43. ***************
  44. *** 89,95 ****
  45.                   }
  46.               }
  47.           } else if(!(fp = fopen(*av, "r"))) {
  48. !             perror(fp);
  49.               exit(1);
  50.           } else {
  51.               if(fstat(fileno(fp), &sb) == 0) {
  52. --- 91,97 ----
  53.                   }
  54.               }
  55.           } else if(!(fp = fopen(*av, "r"))) {
  56. !             perror(*av);
  57.               exit(1);
  58.           } else {
  59.               if(fstat(fileno(fp), &sb) == 0) {
  60. ***************
  61. *** 111,117 ****
  62.               if(!filter) printf("EOF\n");
  63.           }
  64.       }
  65. !     if(!fp) {
  66.           printf("/FILEDATE DATE def\n");
  67.           printf("/DATEFONT ITALIC def\n");
  68.           printf("/FILENAME TITLE def\n", *av);
  69. --- 113,119 ----
  70.               if(!filter) printf("EOF\n");
  71.           }
  72.       }
  73. !     if(!gotfile) {
  74.           printf("/FILEDATE DATE def\n");
  75.           printf("/DATEFONT ITALIC def\n");
  76.           printf("/FILENAME TITLE def\n", *av);
  77. ***************
  78. *** 261,267 ****
  79.                   }
  80.                   if(oldstyle != newstyle) {
  81.                       if(intext) endtext();
  82. !                     printf(stylename[newstyle]);
  83.                       begintext();
  84.                       intext = 1;
  85.                       oldstyle = newstyle;
  86. --- 263,269 ----
  87.                   }
  88.                   if(oldstyle != newstyle) {
  89.                       if(intext) endtext();
  90. !                     printf("%s", stylename[newstyle]);
  91.                       begintext();
  92.                       intext = 1;
  93.                       oldstyle = newstyle;
  94. ***************
  95. *** 282,288 ****
  96.                       intext = 0;
  97.                   }
  98.                   if(oldstyle != newstyle) {
  99. !                     printf(newstyle);
  100.                       oldstyle = newstyle;
  101.                   }
  102.                   printos(col);
  103. --- 284,290 ----
  104.                       intext = 0;
  105.                   }
  106.                   if(oldstyle != newstyle) {
  107. !                     printf("%s", stylename[newstyle]);
  108.                       oldstyle = newstyle;
  109.                   }
  110.                   printos(col);
  111. -- 
  112. Peter da Silva.  <peter@sugar.neosoft.com>.
  113.  `-_-'   Oletko halannut suttasi táΣnáΣáΣn?
  114.   'U`    
  115. Tarjoilija, táΣmáΣ ateria eláΣáΣ vieláΣ.
  116.