From: Bert Vermeulen Date: Fri, 1 Aug 2014 10:03:42 +0000 (+0200) Subject: input/csv: Match format on .csv extension in filename. X-Git-Tag: libsigrok-0.4.0~1180 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b866fc095d8f80621551af5b97102d630591f73b;p=libsigrok.git input/csv: Match format on .csv extension in filename. --- diff --git a/src/input/csv.c b/src/input/csv.c index 6dd06f48..1218cd64 100644 --- a/src/input/csv.c +++ b/src/input/csv.c @@ -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;