diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-04-28 01:43:45 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-04-28 01:43:45 +0000 |
commit | dbdc0476c3ed226ccba2750b09e25887ba12b2bb (patch) | |
tree | b80cbcdbd9c08008b5b84125180f8a3e9c8a190e | |
parent | 7258bf2ba30955d20dc0ba361df7c2de43704f5a (diff) | |
download | netpbm-mirror-dbdc0476c3ed226ccba2750b09e25887ba12b2bb.tar.gz netpbm-mirror-dbdc0476c3ed226ccba2750b09e25887ba12b2bb.tar.xz netpbm-mirror-dbdc0476c3ed226ccba2750b09e25887ba12b2bb.zip |
Release 10.35.63
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@902 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | Makefile.version | 2 | ||||
-rw-r--r-- | converter/other/pamtosvg/fit.c | 1 | ||||
-rw-r--r-- | converter/pbm/pbmtomacp.c | 3 | ||||
-rw-r--r-- | converter/ppm/ximtoppm.c | 4 | ||||
-rw-r--r-- | converter/ppm/xvminitoppm.c | 8 | ||||
-rw-r--r-- | doc/HISTORY | 21 | ||||
-rwxr-xr-x | editor/ppmfade | 2 | ||||
-rwxr-xr-x | editor/ppmquantall | 4 | ||||
-rw-r--r-- | generator/ppmpat.c | 2 | ||||
-rwxr-xr-x | generator/ppmrainbow | 20 | ||||
-rw-r--r-- | lib/ppmdfont.c | 12 |
11 files changed, 61 insertions, 18 deletions
diff --git a/Makefile.version b/Makefile.version index a146d363..a1f06d84 100644 --- a/Makefile.version +++ b/Makefile.version @@ -1,3 +1,3 @@ NETPBM_MAJOR_RELEASE = 10 NETPBM_MINOR_RELEASE = 35 -NETPBM_POINT_RELEASE = 62 +NETPBM_POINT_RELEASE = 63 diff --git a/converter/other/pamtosvg/fit.c b/converter/other/pamtosvg/fit.c index 08db41db..6bc2fe88 100644 --- a/converter/other/pamtosvg/fit.c +++ b/converter/other/pamtosvg/fit.c @@ -1852,6 +1852,7 @@ find_error (curve_type curve, spline_type spline, unsigned *worst_point, if (*worst_point == CURVE_LENGTH (curve) + 1) { /* Didn't have any ``worst point''; the error should be zero. */ + *worst_point = 0; if (epsilon_equal (total_error, 0.0)) LOG (" Every point fit perfectly.\n"); else diff --git a/converter/pbm/pbmtomacp.c b/converter/pbm/pbmtomacp.c index 82b55904..ad0b22b1 100644 --- a/converter/pbm/pbmtomacp.c +++ b/converter/pbm/pbmtomacp.c @@ -38,7 +38,6 @@ char *argv[]; int argn, rows, cols; int left,bottom,right,top; int lflg, rflg, tflg, bflg; - char name[100]; const char * const usage = "[-l left] [-r right] [-b bottom] [-t top] [pbmfile]"; @@ -84,11 +83,9 @@ char *argv[]; if ( argn == argc ) { ifp = stdin; - strcpy( name, "noname" ); } else { ifp = pm_openr( argv[argn] ); - strcpy( name, argv[argn] ); ++argn; } diff --git a/converter/ppm/ximtoppm.c b/converter/ppm/ximtoppm.c index 96798707..28c9b674 100644 --- a/converter/ppm/ximtoppm.c +++ b/converter/ppm/ximtoppm.c @@ -50,6 +50,10 @@ parseCommandLine(int argc, char ** argv, OPTENT3(0, "alphaout", OPT_STRING, &cmdlineP->alpha_filename, &alphaoutSpec, 0); + opt.opt_table = option_def; + opt.short_allowed = FALSE; /* We have no short (old-fashioned) options */ + opt.allowNegNum = FALSE; /* We have no parms that are negative numbers */ + optParseOptions3(&argc, argv, opt, sizeof(opt), 0); /* Uses and sets argc, argv, and all of *cmdlineP. */ diff --git a/converter/ppm/xvminitoppm.c b/converter/ppm/xvminitoppm.c index 030139fa..935ab177 100644 --- a/converter/ppm/xvminitoppm.c +++ b/converter/ppm/xvminitoppm.c @@ -52,7 +52,7 @@ parseCommandLine(int const argc, static void -getline(FILE * const ifP, +getLine(FILE * const ifP, char * const buf, size_t const size) { @@ -105,7 +105,7 @@ readXvHeader(FILE * const ifP, int rc; bool endOfComments; - getline(ifP, buf, sizeof(buf)); + getLine(ifP, buf, sizeof(buf)); if (!STRNEQ(buf, "P7 332", 6)) pm_error("Input is not a XV thumbnail picture. It does not " @@ -113,14 +113,14 @@ readXvHeader(FILE * const ifP, endOfComments = FALSE; while (!endOfComments) { - getline(ifP, buf, sizeof(buf)); + getLine(ifP, buf, sizeof(buf)); if (STRNEQ(buf, "#END_OF_COMMENTS", 16)) endOfComments = TRUE; else if (STRNEQ(buf, "#BUILTIN", 8)) pm_error("This program does not know how to " "convert builtin XV thumbnail pictures"); } - getline(ifP, buf, sizeof(buf)); + getLine(ifP, buf, sizeof(buf)); rc = sscanf(buf, "%u %u %u", &cols, &rows, &maxval); if (rc != 3) pm_error("error parsing dimension info '%s'. " diff --git a/doc/HISTORY b/doc/HISTORY index d8195f5e..dff0a79b 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,6 +4,27 @@ Netpbm. CHANGE HISTORY -------------- +09.04.28 BJH Release 10.35.63 + + ximtoppm: fix crash in command line processing. + + ppmrainbow: exit with proper exit status upon failure. + + ppmfade: eliminate reference to undeclared subroutine. + + ppmquantall: don't use 'set' to set Bourne shell variable. + + pbmtomacp: fix buffer overflow. + + pamtosvg: some fix. + + ppmpat: fix usage statement. + + libnetpbm (ppmd): fix: don't ignore failure to read font file. + + build: rename getline() in xvminitoppm.c to avoid collision + with libc. + 09.04.12 BJH Release 10.35.62 pamstereogram: fix tuple type in output file (and crash diff --git a/editor/ppmfade b/editor/ppmfade index 2507eaf2..9bd122e9 100755 --- a/editor/ppmfade +++ b/editor/ppmfade @@ -35,6 +35,8 @@ my $mode = $SPREAD; # default fading mode # # Check those command line args. # +sub usage(); + if (@ARGV == 0) { usage(); } diff --git a/editor/ppmquantall b/editor/ppmquantall index af1ce22c..bc314d4d 100755 --- a/editor/ppmquantall +++ b/editor/ppmquantall @@ -62,8 +62,8 @@ files=($@) # To be robust, we need to use Pnmfile to get that information, or # Put this program in C and use ppm_readppminit(). -set widths=() -set heights=() +widths=() +heights=() for i in ${files[@]}; do widths=(${widths[*]} `grep -v '^#' $i | sed '1d; s/ .*//; 2q'`) diff --git a/generator/ppmpat.c b/generator/ppmpat.c index 343100d5..f4190d6c 100644 --- a/generator/ppmpat.c +++ b/generator/ppmpat.c @@ -919,7 +919,7 @@ main(int argc, char ** argv) { #define PAT_CAMO 7 #define PAT_ANTICAMO 8 #define PAT_TEST 9 - const char* const usage = "-gingham|-g2|-gingham3|-g3|-madras|-tartan|-poles|-squig|-camo|-anticamo <width> <height>"; + const char* const usage = "-gingham2|-g2|-gingham3|-g3|-madras|-tartan|-poles|-squig|-camo|-anticamo <width> <height>"; ppm_init(&argc, argv); diff --git a/generator/ppmrainbow b/generator/ppmrainbow index 0effeecf..f98536cd 100755 --- a/generator/ppmrainbow +++ b/generator/ppmrainbow @@ -6,6 +6,13 @@ my ($FALSE, $TRUE) = (0,1); (my $myname = $0) =~ s#\A.*/##; +sub fatal($) { + my ($msg) = @_; + + print(STDERR "$msg\n"); + exit(1); +} + my ($Twid, $Thgt, $tmpdir, $norepeat, $verbose); # set defaults @@ -21,15 +28,16 @@ GetOptions("width=i" => \$Twid, "norepeat!" => \$norepeat, "verbose!" => \$verbose); -die "invalid width and/or height\n" unless $Twid >= 1 && $Thgt >= 1; - +if ($Twid < 1 || $Thgt < 1) { + fatal("invalid width and/or height"); +} my $verboseCommand = $verbose ? "set -x;" : ""; if (@ARGV < 1) { - die("You must specify at least one color as an argument"); + fatal("You must specify at least one color as an argument"); } elsif (@ARGV < 2 && $norepeat) { - die("With the -norepeat option, you must specify at least two colors " . - "as arguments."); + fatal("With the -norepeat option, you must specify at least two colors " . + "as arguments."); } my @colorlist; @@ -57,7 +65,7 @@ while (@colorlist >= 2) { my $rc = system("$verboseCommand pgmramp -lr $w $Thgt | " . "pgmtoppm \"$colorlist[0]-$colorlist[1]\" >$outfile"); if ($rc != 0) { - die("pgmramp|pgmtoppm failed."); + fatal("pgmramp|pgmtoppm failed."); } $widthRemaining -= $w; $n++; diff --git a/lib/ppmdfont.c b/lib/ppmdfont.c index a378f79c..c0db3f51 100644 --- a/lib/ppmdfont.c +++ b/lib/ppmdfont.c @@ -1,5 +1,7 @@ #include <stdio.h> #include <assert.h> +#include <errno.h> +#include <string.h> #include "pm.h" #include "mallocvar.h" @@ -62,7 +64,15 @@ static void readFontHeader(FILE * const ifP, struct ppmd_fontHeader * const fontHeaderP) { - fread(&fontHeaderP->signature, 1, sizeof(fontHeaderP->signature), ifP); + size_t rc; + + rc = fread(&fontHeaderP->signature, 1, sizeof(fontHeaderP->signature), + ifP); + + if (rc != sizeof(fontHeaderP->signature)) + pm_error("Unable to read the header from the font file. " + "errno=%d (%s)", errno, strerror(errno)); + fontHeaderP->format = fgetc(ifP); fontHeaderP->characterCount = fgetc(ifP); fontHeaderP->firstCodePoint = fgetc(ifP); |