Project

General

Profile

Bug #7468

smbios`print_chassis() does a comparison which is always false

Added by Yuri Pankov over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
cmd - userland programs
Start date:
2016-10-14
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

found by clang:

smbios.c:343:8: error: comparison of array 'c.smbc_sku' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
            c.smbc_sku == NULL ? "<unknown>" : c.smbc_sku);

indeed, smbc_sku is defined as char[256] and can't be NULL, so we should be rather checking if the string is empty, ie, c.smbc_sku[0] == '\0'.

History

#1

Updated by Yuri Pankov over 3 years ago

  • Description updated (diff)
#2

Updated by Yuri Pankov over 3 years ago

  • Description updated (diff)
#3

Updated by Yuri Pankov over 3 years ago

  • Status changed from New to In Progress
  • Assignee set to Yuri Pankov
  • % Done changed from 0 to 50
#4

Updated by Electric Monk over 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 50 to 100

git commit d54e4739dac82a1ec2e41c84cf31866030ac5055

commit  d54e4739dac82a1ec2e41c84cf31866030ac5055
Author: Yuri Pankov <yuri.pankov@nexenta.com>
Date:   2016-10-20T13:58:27.000Z

    7468 smbios`print_chassis() does a comparison which is always false
    Reviewed by: Richard Lowe <richlowe@richlowe.net>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF