Skip to content

Commit

Permalink
Use 4-arg error messages for a few I/O functions
Browse files Browse the repository at this point in the history
* This returns the name of the file that failed to open
  • Loading branch information
DanBloomberg committed Jan 23, 2024
1 parent dc55894 commit 9606115
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/gplot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ GPLOT *gplot;
LEPT_FREE(ylabel);
if (!gplot) {
fclose(fp);
return (GPLOT *)ERROR_PTR("gplot not made", __func__, NULL);
return (GPLOT *)ERROR_PTR_1("gplot not made", filename, __func__, NULL);
}
sarrayDestroy(&gplot->cmddata);
sarrayDestroy(&gplot->datanames);
Expand Down
6 changes: 4 additions & 2 deletions src/pdfio2.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,8 @@ FILE *fp;
data85 = encodeAscii85(data, nbytes, &nbytes85);
LEPT_FREE(data);
if (!data85)
return (L_COMP_DATA *)ERROR_PTR("data85 not made", __func__, NULL);
return (L_COMP_DATA *)ERROR_PTR_1("data85 not made",
fname, __func__, NULL);
else
data85[nbytes85 - 1] = '\0'; /* remove the newline */
}
Expand Down Expand Up @@ -1156,7 +1157,8 @@ FILE *fp;
data85 = encodeAscii85(datacomp, nbytescomp, &nbytes85);
LEPT_FREE(datacomp);
if (!data85)
return (L_COMP_DATA *)ERROR_PTR("data85 not made", __func__, NULL);
return (L_COMP_DATA *)ERROR_PTR_1("data85 not made",
fname, __func__, NULL);
else
data85[nbytes85 - 1] = '\0'; /* remove the newline */
}
Expand Down
2 changes: 1 addition & 1 deletion src/psio2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ FILE *fp;

for (i = 0; i < npages; i++) {
if ((pix = pixReadTiff(filein, i)) == NULL)
return ERROR_INT("pix not made", __func__, 1);
return ERROR_INT_1("pix not made", filein, __func__, 1);

pixGetDimensions(pix, &w, &h, NULL);
if (w == 1728 && h < w) /* it's a std res fax */
Expand Down
2 changes: 1 addition & 1 deletion version-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h2 align=center> <IMG SRC="moller52.jpg" border=1 ALIGN_MIDDLE> </h2>
<pre>

1.85 not released
* Source files changed: gplot.c, partify.c
* Source files changed: gplot.c, partify.c, pdfio2.c, psio2.c

1.84.1 Jan 3, 2024
* Remove support for openjpeg versions < 2.1.
Expand Down

0 comments on commit 9606115

Please sign in to comment.