Index: trunk/ippTools/src/regtool.c
===================================================================
--- trunk/ippTools/src/regtool.c	(revision 12347)
+++ trunk/ippTools/src/regtool.c	(revision 13580)
@@ -23,4 +23,6 @@
 
 #include <stdlib.h>
+#include <stdint.h>
+#include <math.h>
 
 #include "pxtools.h"
@@ -422,7 +424,11 @@
 
     bool status = false;
-    psS8 code = psMetadataLookupS8(&status, config->args, "-code");
+    psS16 code = psMetadataLookupS16(&status, config->args, "-code");
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
+        return false;
+    }
+    if (code == INT16_MAX) {
+        psError(PS_ERR_UNKNOWN, true, "-code is required");
         return false;
     }
@@ -753,7 +759,11 @@
 {
     bool status = false;
-    psS8 code = psMetadataLookupS8(&status, config->args, "-code");
+    psS16 code = psMetadataLookupS16(&status, config->args, "-code");
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
+        return false;
+    }
+    if (code == INT16_MAX) {
+        psError(PS_ERR_UNKNOWN, true, "-code is required");
         return false;
     }
@@ -946,5 +956,5 @@
 
     // default
-    psS8 code = psMetadataLookupS8(&status, config->args, "-code");
+    psS16 code = psMetadataLookupS16(&status, config->args, "-code");
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
@@ -1099,5 +1109,5 @@
     }
 
-    psS8 code = psMetadataLookupS8(&status, config->args, "-code");
+    psS16 code = psMetadataLookupS16(&status, config->args, "-code");
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
