From: Aurelien Jacobs Date: Sun, 26 Apr 2015 22:13:23 +0000 (+0200) Subject: wav: Stricter check for valid chunk ID. X-Git-Tag: libsigrok-0.4.0~520 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=94b138a3c3d07cf5581c07536c53a97cebf885d9;p=libsigrok.git wav: Stricter check for valid chunk ID. isascii() is a superset of isalpha() and isblank() so the current code doesn't really make sense. Moreover, isascii(x) is just a funky and non standard way to write x < 128. --- diff --git a/src/input/wav.c b/src/input/wav.c index 271bacef..4f36e8c4 100644 --- a/src/input/wav.c +++ b/src/input/wav.c @@ -165,8 +165,7 @@ static int find_data_chunk(GString *buf, int initial_offset) /* Skip into the samples. */ return offset + 8; for (i = 0; i < 4; i++) { - if (!isalpha(buf->str[offset + i]) - && !isascii(buf->str[offset + i]) + if (!isalnum(buf->str[offset + i]) && !isblank(buf->str[offset + i])) /* Doesn't look like a chunk ID. */ return -1;