From: Bert Vermeulen Date: Thu, 2 Oct 2014 10:57:19 +0000 (+0200) Subject: sr_parse_sizestring: Deal with invalid strings better. X-Git-Tag: libsigrok-0.4.0~908 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=19e43ab21badac678f4a452e0dd629a0f7917d16;p=libsigrok.git sr_parse_sizestring: Deal with invalid strings better. This cleans up a warning generated by clang's static analyzer. --- diff --git a/src/strutil.c b/src/strutil.c index 54dc1f39..0306ea7c 100644 --- a/src/strutil.c +++ b/src/strutil.c @@ -426,7 +426,7 @@ SR_API int sr_parse_sizestring(const char *sizestring, uint64_t *size) } else *size += frac_part; - if (*s && strcasecmp(s, "Hz")) + if (s && *s && strcasecmp(s, "Hz")) return SR_ERR; return SR_OK;