comparison tools/packed.c @ 2004:161e731eb152

Improve dmGetIntVal() to accept an optional negative value boolean flag pointer. Also improve error handling in it.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 07 Jul 2018 01:11:22 +0300
parents 33c29e7d1861
children 0fe1bce4e8a5
comparison
equal deleted inserted replaced
2003:2ae47dcaaf10 2004:161e731eb152
119 dmVerbosity++; 119 dmVerbosity++;
120 break; 120 break;
121 121
122 case 4: 122 case 4:
123 { 123 {
124 unsigned int i; 124 unsigned int tmpUI;
125 if (!dmGetIntVal(optArg, &i)) 125 if (!dmGetIntVal(optArg, &tmpUI, NULL))
126 { 126 {
127 dmErrorMsg("Invalid flags value '%s'.\n", optArg); 127 dmErrorMsg("Invalid flags value '%s'.\n", optArg);
128 return FALSE; 128 return FALSE;
129 } 129 }
130 optDefResFlags = i; 130 optDefResFlags = tmpUI;
131 } 131 }
132 break; 132 break;
133 133
134 case 5: 134 case 5:
135 if (nexcFilenames < SET_MAX_FILES) 135 if (nexcFilenames < SET_MAX_FILES)