]> mj.ucw.cz Git - pciutils.git/blobdiff - setpci.c
Be ISO C89 compliant (still needed for MSVC)
[pciutils.git] / setpci.c
index 21858bdfdddec8be1a9f674bdd777b1d88b2c32f..5711e5105a9d49ab107c1cff3d82140d0da8f054 100644 (file)
--- a/setpci.c
+++ b/setpci.c
@@ -482,11 +482,12 @@ static const struct reg_name *parse_reg_name(char *name)
 static int parse_x32(char *c, char **stopp, unsigned int *resp)
 {
   char *stop;
+  unsigned long int l;
 
   if (!*c)
     return -1;
   errno = 0;
-  unsigned long int l = strtoul(c, &stop, 16);
+  l = strtoul(c, &stop, 16);
   if (errno)
     return -1;
   if ((l & ~0U) != l)
@@ -499,7 +500,11 @@ static int parse_x32(char *c, char **stopp, unsigned int *resp)
       return 0;
     }
   else
-    return 1;
+    {
+      if (stopp)
+       *stopp = NULL;
+      return 1;
+    }
 }
 
 static void parse_register(struct op *op, char *base)