settings: Allow spaces in time settings before the optional unit

This commit is contained in:
Martin Willi
2014-07-07 16:58:05 +02:00
parent 0058e26cb0
commit a51c48eeaa
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -23,6 +23,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
#include "settings.h"
#include "settings_types.h"
@@ -584,6 +585,10 @@ inline u_int32_t settings_value_as_time(char *value, u_int32_t def)
}
if (errno == 0)
{
while (isspace(*endptr))
{
endptr++;
}
switch (*endptr)
{
case 'd': /* time in days */