diff 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
line wrap: on
line diff
--- a/tools/packed.c	Tue Jul 03 09:54:14 2018 +0300
+++ b/tools/packed.c	Sat Jul 07 01:11:22 2018 +0300
@@ -121,13 +121,13 @@
 
         case 4:
             {
-                unsigned int i;
-                if (!dmGetIntVal(optArg, &i))
+                unsigned int tmpUI;
+                if (!dmGetIntVal(optArg, &tmpUI, NULL))
                 {
                     dmErrorMsg("Invalid flags value '%s'.\n", optArg);
                     return FALSE;
                 }
-                optDefResFlags = i;
+                optDefResFlags = tmpUI;
             }
             break;