ports/textproc/heirloom-doctools/files/patch-refer_refer5.c
Hiroki Sato a325abe66b - Fix bugs which could cause SIGSEGV.
- Fix an odd error message "sort: file not found".
  It was not harmful but confusing.
- Increase the maximum number of vertexes in a spline curve.
  100 vertexes were too small in modern environments.
- Use _PATH_* wherever possible.
2017-03-30 23:54:24 +00:00

22 lines
535 B
C

--- refer/refer5.c.orig 2016-03-09 21:27:38 UTC
+++ refer/refer5.c
@@ -148,14 +148,18 @@ putsig (int nf, char **flds, int nref, c
flout();
sig[0] = 0;
prevsig = 0;
- if (fo == fhide) {
+ if (fhide != NULL && fo == fhide) {
int ch;
fclose(fhide);
fhide = fopen(hidenam, "r");
+ if (fhide == NULL)
+ err("Can't get scratch file %s",
+ hidenam);
fo = ftemp;
while ((ch = getc(fhide)) != EOF)
putc(ch, fo);
fclose(fhide);
+ fhide = NULL;
unlink(hidenam);
}
}