Compile rpcgen-generated files with -fno-strict-aliasing
[libguestfs.git] / inspector / virt-inspector.c
index 86d0654..4d2824c 100644 (file)
@@ -23,6 +23,7 @@
 #include <inttypes.h>
 #include <unistd.h>
 #include <getopt.h>
+#include <locale.h>
 #include <assert.h>
 
 #include <libxml/xmlIO.h>
@@ -118,11 +119,9 @@ main (int argc, char *argv[])
   };
   struct drv *drvs = NULL;
   struct drv *drv;
-  char *p, *file = NULL;
   const char *format = NULL;
   int c;
   int option_index;
-  int next_prepared_drive = 1;
 
   g = guestfs_create ();
   if (g == NULL) {
@@ -632,7 +631,7 @@ canonicalize (char *dev)
       (dev[5] == 'h' || dev[5] == 'v') &&
       dev[6] == 'd' &&
       c_isalpha (dev[7]) &&
-      c_isdigit (dev[8]))
+      (c_isdigit (dev[8]) || dev[8] == '\0'))
     dev[5] = 's';
 }