Lines 1-38
Link Here
|
1 |
--- hpscat.c.orig 1995-11-23 07:46:12.000000000 -0500 |
1 |
--- hpscat.c.orig 2019-08-03 11:25:44 UTC |
2 |
+++ hpscat.c 2013-06-12 17:10:59.000000000 -0400 |
2 |
+++ hpscat.c |
3 |
@@ -12,13 +12,14 @@ |
3 |
@@ -62,7 +62,7 @@ open_outfile(s) /* returns -1 if can |
4 |
bool cheat; |
4 |
if(ofp=fopen(buf,"r")) { /* file exists */ |
5 |
FILE *fp, *ofp; |
|
|
6 |
|
7 |
+static int open_outfile(char *); |
8 |
+ |
9 |
/**************** |
10 |
main routine |
11 |
****************/ |
12 |
|
13 |
-main(ac,av) |
14 |
- int ac; |
15 |
- char *av[]; |
16 |
+int |
17 |
+main(int ac, char *av[]) |
18 |
{ |
19 |
int i; |
20 |
extern void showfile PROT((char *)); |
21 |
@@ -53,13 +54,13 @@ |
22 |
exit(0); |
23 |
} |
24 |
|
25 |
-int |
26 |
-open_outfile(s) /* returns -1 if can't write */ |
27 |
- char *s; |
28 |
+static int |
29 |
+open_outfile(char *s) /* returns -1 if can't write */ |
30 |
{ |
31 |
char ans[80], buf[256]; |
32 |
sprintf(buf,"%s.ps", s); |
33 |
- if(ofp=fopen(buf,"r")) { /* file exists */ |
34 |
+ ofp=fopen(buf,"r"); |
35 |
+ if(ofp) { /* file exists */ |
36 |
fclose(ofp); |
5 |
fclose(ofp); |
37 |
fprintf(stderr,"output file %s exists...overwrite? ", buf); |
6 |
fprintf(stderr,"output file %s exists...overwrite? ", buf); |
38 |
gets(ans); |
7 |
- gets(ans); |
|
|
8 |
+ fgets(buf,256,ans); |
9 |
if(ans[0]=='y') |
10 |
unlink(buf); |
11 |
else |