ports/graphics/jbigkit/files/patch-warnings
Mikhail Teterin 2252355e08 Upgrade from 1.8 to 2.1
PR:		184585
Submitted by:	Adam Weinberger
2014-06-21 21:44:45 +00:00

36 lines
881 B
Text

--- pbmtools/pbmtojbg85.c 2014-03-27 14:47:15.000000000 -0400
+++ pbmtools/pbmtojbg85.c 2014-04-08 09:00:16.000000000 -0400
@@ -71,8 +71,12 @@
if (c != EOF) {
ungetc(c, f);
- fscanf(f, "%lu", &i);
- }
+ if (fscanf(f, "%lu", &i) == 1)
+ return i;
+ else
+ fprintf(stderr, "%s: corrupt input", progname);
+ } else
+ fprintf(stderr, "%s: unexpected end of input", progname);
- return i;
+ return -1;
}
--- pbmtools/pbmtojbg.c 2014-03-27 14:47:15.000000000 -0400
+++ pbmtools/pbmtojbg.c 2014-04-08 09:00:16.000000000 -0400
@@ -87,8 +87,12 @@
if (c != EOF) {
ungetc(c, f);
- fscanf(f, "%lu", &i);
- }
+ if (fscanf(f, "%lu", &i) == 1)
+ return i;
+ else
+ fprintf(stderr, "%s: corrupt input", progname);
+ } else
+ fprintf(stderr, "%s: unexpected end of input", progname);
- return i;
+ return -1;
}