From c12dee326feab9f70f5ffaa0f64299a02484616b Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Sat, 6 Aug 2016 15:10:14 +0000 Subject: [PATCH] Check the first byte of the array for NUL, instead of the array as a NULL pointer The partition_name field is an array, so can never be NULL itself. Check only the first byte instead. This was found when test building with clang, but I'm not sure how it passes gcc's warnings either. --- contrib/binutils/bfd/ppcboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/binutils/bfd/ppcboot.c b/contrib/binutils/bfd/ppcboot.c index da8c6b8019bd..54a482dc9ee3 100644 --- a/contrib/binutils/bfd/ppcboot.c +++ b/contrib/binutils/bfd/ppcboot.c @@ -419,7 +419,7 @@ ppcboot_bfd_print_private_bfd_data (abfd, farg) if (tdata->header.os_id) fprintf (f, "OS_ID = 0x%.2x\n", tdata->header.os_id); - if (tdata->header.partition_name) + if (tdata->header.partition_name[0]) fprintf (f, _("Partition name = \"%s\"\n"), tdata->header.partition_name); for (i = 0; i < 4; i++)