Fix gcc 4.7 warning in usbtest.c
Building grub2 with gcc 4.7 snapshot, I see:commands/usbtest.c: In function 'usb_print_str':commands/usbtest.c:126:19: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
cc1: all warnings being treated as errors
line 121 is:
121: err = grub_usb_get_string (dev, idx, 0x0409, &name);
gcc does not seem to understand that name is only set if grub_usb_get_string returns without an error.
Here's the obvious patch to fix this,
Andreas
grub-core/commands/usbtest.c +1 -1
@@ -111,7 +111,7 @@ grub_usb_get_string (grub_usb_device_t dstatic void usb_print_str (const char *description,grub_usb_device_t dev,int idx) { -char *name; +char *name =NULL ;grub_usb_err_t err;/* XXX: LANGID */