input/csv: Match format on .csv extension in filename.

This commit is contained in:
Bert Vermeulen 2014-08-01 12:03:42 +02:00
parent cb41a838a7
commit b866fc095d
1 changed files with 4 additions and 0 deletions

View File

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