mirror of
https://github.com/owntracks/recorder.git
synced 2026-05-07 02:46:36 +00:00
cleanup sane check
This commit is contained in:
10
recorder.c
10
recorder.c
@@ -228,7 +228,7 @@ static int csv_looks_sane(char *payload)
|
||||
{
|
||||
static int virgin = 1;
|
||||
static regex_t regex;
|
||||
int reti, sane = FALSE;
|
||||
int nomatch;
|
||||
int cflags = REG_EXTENDED | REG_ICASE | REG_NOSUB;
|
||||
|
||||
if (virgin) {
|
||||
@@ -240,13 +240,9 @@ static int csv_looks_sane(char *payload)
|
||||
}
|
||||
}
|
||||
|
||||
reti = regexec(®ex, payload, 0, NULL, 0);
|
||||
if (!reti) {
|
||||
sane = TRUE;
|
||||
}
|
||||
nomatch = regexec(®ex, payload, 0, NULL, 0);
|
||||
|
||||
// regfree(®ex);
|
||||
return (sane);
|
||||
return (nomatch ? FALSE : TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user