opnsense-ports/graphics/jbigkit/files/patch-warnings
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01: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;
}