]> git.ipfire.org Git - thirdparty/util-linux.git/commit
include: fix compiler warning
authorSami Kerola <kerolasa@iki.fi>
Sun, 5 Mar 2017 20:52:28 +0000 (20:52 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Mar 2017 13:48:14 +0000 (14:48 +0100)
commitfdf8e1f595b45337b7d12ab6ac9faf6040fe913c
treee9e4bc63a5e91a09c76c8fa1718fea9aaaf5e509
parent57f1539592c43dcf4c33eddcc022b47d3a64d177
include: fix compiler warning

./include/optutils.h:12:18: warning: null pointer dereference [-Wnull-dereference]
  for (o = opts; o->name; o++)
                 ~^~~~~~
In file included from libfdisk/src/dos.c:12:0:
./include/pt-mbr.h:25:47: warning: potential null pointer dereference [-Wnull-dereference]
  return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
         ~^~~

Well these should be impossible, so add assert() to catch possible bugs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/optutils.h
include/pt-mbr.h