]> sigrok.org Git - libsigrok.git/commitdiff
wav: Stricter check for valid chunk ID.
authorAurelien Jacobs <redacted>
Sun, 26 Apr 2015 22:13:23 +0000 (00:13 +0200)
committerUwe Hermann <redacted>
Tue, 28 Apr 2015 20:05:47 +0000 (22:05 +0200)
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.

src/input/wav.c

index 271bacef19b9162aed32ab396a347579cbcee87b..4f36e8c45126aac8791a55ddef31563bab0db2cc 100644 (file)
@@ -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;