From af1a80d96f9bfb2086dd5314904d08583773df09 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Fri, 29 Sep 2023 18:22:35 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4707 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/libppm1.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'lib/libppm1.c') diff --git a/lib/libppm1.c b/lib/libppm1.c index 9df1f213..577c9c64 100644 --- a/lib/libppm1.c +++ b/lib/libppm1.c @@ -64,26 +64,12 @@ ppm_nextimage(FILE * const fileP, void -ppm_readppminitrest(FILE * const fileP, +ppm_readppminitrest(FILE * const ifP, int * const colsP, int * const rowsP, pixval * const maxvalP) { - unsigned int maxval; - - /* Read size. */ - *colsP = (int)pm_getuint(fileP); - *rowsP = (int)pm_getuint(fileP); - - /* Read maxval. */ - maxval = pm_getuint(fileP); - if (maxval > PPM_OVERALLMAXVAL) - pm_error("maxval of input image (%u) is too large. " - "The maximum allowed by the PPM format is %u.", - maxval, PPM_OVERALLMAXVAL); - if (maxval == 0) - pm_error("maxval of input image is zero."); - - *maxvalP = maxval; + + pgm_readpgminitrest(ifP, colsP, rowsP, maxvalP); } -- cgit 1.4.1