diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:07:55 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:07:55 +0000 |
commit | 11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32 (patch) | |
tree | 7c40f096dd973943ef563ec87b2a68d8205db4fb /converter/pbm/cmuwmtopbm.c | |
parent | 89c6ec14eb7514630aea5abc4b90b51d1473d33a (diff) | |
download | netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.tar.gz netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.tar.xz netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.zip |
Promote Stable to Super_stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@3640 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/pbm/cmuwmtopbm.c')
-rw-r--r-- | converter/pbm/cmuwmtopbm.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/converter/pbm/cmuwmtopbm.c b/converter/pbm/cmuwmtopbm.c index eabff40c..ccf8cfc9 100644 --- a/converter/pbm/cmuwmtopbm.c +++ b/converter/pbm/cmuwmtopbm.c @@ -20,9 +20,17 @@ #include "pbm.h" -#include "cmuwm.h" +/*-------------------------- + CMUWN Header format: + 32 bit const magic = 0xf10040bb ; + 32 bit int width; + 32 bit int height; + 16 bit int depth; + + values are big-endian. +--------------------------*/ static void readCmuwmHeader(FILE * const ifP, @@ -32,6 +40,7 @@ readCmuwmHeader(FILE * const ifP, const char * const initReadError = "CMU window manager header EOF / read error"; + uint32_t const cmuwmMagic = 0xf10040bb; long l; short s; @@ -39,20 +48,20 @@ readCmuwmHeader(FILE * const ifP, rc = pm_readbiglong(ifP, &l); if (rc == -1 ) - pm_error(initReadError); - if ((uint32_t)l != CMUWM_MAGIC) + pm_error("%s", initReadError); + if ((uint32_t)l != cmuwmMagic) pm_error("bad magic number in CMU window manager file"); rc = pm_readbiglong(ifP, &l); if (rc == -1) - pm_error(initReadError); + pm_error("%s", initReadError); *colsP = l; rc = pm_readbiglong(ifP, &l); if (rc == -1 ) - pm_error(initReadError); + pm_error("%s", initReadError); *rowsP = l; rc = pm_readbigshort(ifP, &s); if (rc == -1) - pm_error(initReadError); + pm_error("%s", initReadError); *depthP = s; } |