]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 349] killtime couldn't be >= 24 days after sendtime
authorDarren Nickerson <darren.nickerson@ifax.com>
Fri, 13 Sep 2002 16:20:34 +0000 (16:20 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Fri, 13 Sep 2002 16:20:34 +0000 (16:20 +0000)
Setting killtime (LASTTIME) to a time >= 24 days after sendtime would not work
as expected. The number of days was passed through a modulo 24 so having a
killtime of now+31days resulted in a killtime of now+7 days.
Thanks to Patrice for this fix.

hfaxd/Parser.c++

index eaa6ed5d07ec254dda5b8b385abce98b146df489..39cc64f657f686f1b06e7dca5203293b52666521 100644 (file)
@@ -1279,7 +1279,7 @@ HylaFAXServer::TIMESPEC(u_int len, time_t& result)
        if (tokenBody.length() == len) {
            if (checkNUMBER(tokenBody)) {
                const char* cp = tokenBody;
-               if (len == 12) {                // YYYYMMDDHHSS
+               if (len == 12) {                // YYYYMMDDHHMM
                    struct tm tm;
                    tm.tm_sec  = 0;
                    tm.tm_min  = twodigits(cp+10, 60);
@@ -1296,8 +1296,8 @@ HylaFAXServer::TIMESPEC(u_int len, time_t& result)
                     */
                    result = mktime(&tm) - gmtoff;
                } else if (len == 6) {          // DDHHMM
-                   result = 24*60*60*twodigits(cp, 24)
-                          +    60*60*twodigits(cp+2, 60)
+                   result = 24*60*60*twodigits(cp, 100)
+                          +    60*60*twodigits(cp+2, 24)
                           +       60*twodigits(cp+4, 60);
                } else {                        // MMSS
                    result = 60*twodigits(cp, 60)