diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-06-26 02:05:42 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-06-26 02:05:42 +0000 |
commit | 4f463b7abea8bc5a6031fe72ab50dc18eeaaa2bf (patch) | |
tree | fd67d42be8b0edb1c78da7393ae8c7d95cdc1d69 /lib/fileio.c | |
parent | 0a7fcd8c888dd70fe961a4b4fc56fa3d0a24b7c3 (diff) | |
download | netpbm-mirror-4f463b7abea8bc5a6031fe72ab50dc18eeaaa2bf.tar.gz netpbm-mirror-4f463b7abea8bc5a6031fe72ab50dc18eeaaa2bf.tar.xz netpbm-mirror-4f463b7abea8bc5a6031fe72ab50dc18eeaaa2bf.zip |
Rebase advanced branch to 10.39
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@330 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/fileio.c')
-rw-r--r-- | lib/fileio.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/fileio.c b/lib/fileio.c index 01243f9d..d891b05a 100644 --- a/lib/fileio.c +++ b/lib/fileio.c @@ -17,23 +17,23 @@ #include "fileio.h" char -pm_getc(FILE * const file) { +pm_getc(FILE * const fileP) { int ich; char ch; - ich = getc(file); + ich = getc(fileP); if (ich == EOF) pm_error("EOF / read error reading a byte"); ch = (char) ich; if (ch == '#') { do { - ich = getc(file); - if (ich == EOF) - pm_error("EOF / read error reading a byte"); - ch = (char) ich; - } while (ch != '\n' && ch != '\r'); - } + ich = getc(fileP); + if (ich == EOF) + pm_error("EOF / read error reading a byte"); + ch = (char) ich; + } while (ch != '\n' && ch != '\r'); + } return ch; } @@ -76,7 +76,7 @@ pm_getuint(FILE * const ifP) { do { ch = pm_getc(ifP); - } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r'); + } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r'); if (ch < '0' || ch > '9') pm_error("junk in file where an unsigned integer should be"); @@ -165,6 +165,3 @@ pm_putraw(FILE * const file, pm_error("Error writing %d byte sample to file.", bytes); } } - - - |