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.
This commit is contained in:
Justin Hibbits 2016-08-06 15:10:14 +00:00
parent 161c415133
commit c12dee326f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=303797

View file

@ -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++)