X-Git-Url: http://git.pk910.de/?p=srvx.git;a=blobdiff_plain;f=src%2Ftools.c;h=983fe9fbddcd72c436e8ba04049b61b946e97854;hp=d4dee86d65e221cd39357f1121752dce95e845ad;hb=839ab9c7c30c63c0bb584da4ab6fe41f54f22ac4;hpb=437ee8606d0f6e8dcc238eb6882d0211df84b3ce diff --git a/src/tools.c b/src/tools.c index d4dee86..983fe9f 100644 --- a/src/tools.c +++ b/src/tools.c @@ -794,12 +794,14 @@ ParseInterval(const char *interval) /* process the string, resetting the count if we find a unit character */ while ((c = *interval++)) { - if (isdigit((int)c)) { - partial = partial*10 + c - '0'; - } else { - seconds += TypeLength(c) * partial; - partial = 0; - } + if (isdigit((int)c)) { + partial = partial*10 + c - '0'; + } else if (strchr("yMwdhms", c)) { + seconds += TypeLength(c) * partial; + partial = 0; + } else { + return 0; + } } /* assume the last chunk is seconds (the normal case) */ return seconds + partial;