Fix Argument with 'nonnull' attribute passed null found by Clang

Change-Id: If1c907308a7c776a6198530663f8dce03839d43b
Reviewed-on: https://code.wireshark.org/review/1098
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2014-04-14 08:59:28 +02:00 committed by Anders Broman
parent dd002649c3
commit 2414d9df46
1 changed files with 5 additions and 0 deletions

View File

@ -463,6 +463,11 @@ parse_num (const char *str, int offset)
guint32 num;
char *c;
if (str == NULL) {
fprintf(stderr, "FATAL ERROR: str is NULL\n");
exit(1);
}
num = (guint32)strtoul(str, &c, offset ? offset_base : 16);
if (c == str) {
fprintf(stderr, "FATAL ERROR: Bad hex number? [%s]\n", str);