diff options
Diffstat (limited to 'converter/pgm/st4topgm.c')
-rw-r--r-- | converter/pgm/st4topgm.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/converter/pgm/st4topgm.c b/converter/pgm/st4topgm.c index 90be6b72..89ec930d 100644 --- a/converter/pgm/st4topgm.c +++ b/converter/pgm/st4topgm.c @@ -56,6 +56,7 @@ validateFileSize(FILE * const ifP) { } + static void writeRaster(FILE * const ifP, struct pam * const pamP) { @@ -69,11 +70,11 @@ writeRaster(FILE * const ifP, unsigned int col; for (col = 0; col < st4Width; ++col) { - char c; + unsigned char c; - pm_readchar(ifP, &c); + pm_readcharu(ifP, &c); - tuplerow[col][0] = (unsigned char)c; + tuplerow[col][0] = c; } pnm_writepamrow(pamP, tuplerow); } @@ -188,15 +189,15 @@ readFooter(FILE * const ifP, static void reportFooter(struct St4Footer const footer) { - pm_message("Comment: %s", footer.comment); + pm_message("Comment: %s", footer.comment); - pm_message("Exposure time (1/100 s): %s", footer.exposureTime); + pm_message("Exposure time (1/100 s): %s", footer.exposureTime); - pm_message("Focal length (in): %s", footer.focalLength); + pm_message("Focal length (in): %s", footer.focalLength); - pm_message("Aperture area (sq in): %s", footer.apertureArea); + pm_message("Aperture area (sq in): %s", footer.apertureArea); - pm_message("Calibration factor: %s", footer.calibrationFactor); + pm_message("Calibration factor: %s", footer.calibrationFactor); } @@ -219,7 +220,7 @@ main(int argc, const char **argv) { pm_error("Too many arguments: %u. " "The only possible argument is the " "optional input file name", argc-1); - } + } /* We check the file size to catch the common problem of the input not being valid ST-4 SBIG input. Unlike most formats, this one does not @@ -258,3 +259,4 @@ main(int argc, const char **argv) { } + |