diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2018-10-02 15:10:58 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2018-10-02 15:10:58 +0000 |
commit | 2dcdf7b8850b6435cd6339f6c77a2e83f52b76f3 (patch) | |
tree | e994502a31e93005521a4d058481741fd6b7cf33 /lib/colorname.c | |
parent | 78d7ff61d197ed876cc6e0c31611d8ddcf2a1fe1 (diff) | |
download | netpbm-mirror-2dcdf7b8850b6435cd6339f6c77a2e83f52b76f3.tar.gz netpbm-mirror-2dcdf7b8850b6435cd6339f6c77a2e83f52b76f3.tar.xz netpbm-mirror-2dcdf7b8850b6435cd6339f6c77a2e83f52b76f3.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3372 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/colorname.c')
-rw-r--r-- | lib/colorname.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/colorname.c b/lib/colorname.c index 596d8788..9400adf7 100644 --- a/lib/colorname.c +++ b/lib/colorname.c @@ -200,10 +200,16 @@ pm_parse_dictionary_namen(char const colorname[], fP = pm_openColornameFile(NULL, TRUE); /* exits if error */ canoncolor = strdup(colorname); + + if (!canoncolor) + pm_error("Failed to allocate memory for %u-byte color name", + (unsigned)strlen(colorname)); + pm_canonstr(canoncolor); - gotit = FALSE; - colorfileExhausted = FALSE; - while (!gotit && !colorfileExhausted) { + + for(gotit = FALSE, colorfileExhausted = FALSE; + !gotit && !colorfileExhausted; ) { + colorfileEntry = pm_colorget(fP); if (colorfileEntry.colorname) { pm_canonstr(colorfileEntry.colorname); |