]> sigrok.org Git - libsigrok.git/commitdiff
input/csv: Match format on .csv extension in filename.
authorBert Vermeulen <redacted>
Fri, 1 Aug 2014 10:03:42 +0000 (12:03 +0200)
committerBert Vermeulen <redacted>
Fri, 1 Aug 2014 10:03:42 +0000 (12:03 +0200)
src/input/csv.c

index 6dd06f4877ccbc4e4f592c4bdca4e807a77a858e..1218cd640fa263d1f0cf9db645fb35c36aa51213 100644 (file)
@@ -134,6 +134,10 @@ struct context {
 
 static int format_match(const char *filename)
 {
+       /* Require .csv extension. */
+       if (strcmp(filename + strlen(filename) - 4, ".csv"))
+               return FALSE;
+
        if (!filename) {
                sr_err("%s: filename was NULL.", __func__);
                return FALSE;