<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 22, 2017 at 4:10 PM, Japheth Cleaver <span dir="ltr"><<a href="mailto:cleaver@terabithia.org" target="_blank">cleaver@terabithia.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2/22/2017 1:06 PM, Ralph Mitchell wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Apparently the tasks.cfg MAXTIME option is not very tolerant of spacing:<br>
<br>
   MAXTIME  10m    - with two spaces, is interpreted as 10 seconds<br>
   MAXTIME 10m     - with one space, is interpreted as 600 seconds<br>
<br>
I think the problem lies at line 276 in xymon-4.3.28/common/xymonlaunc<wbr>h.c:<br>
<br>
                        tspec = p + strspn(p, "0123456789");<br>
                        switch (*tspec) {<br>
                          case 'm': curtask->maxruntime *= 60; break;   /* Minutes */<br>
                          case 'h': curtask->maxruntime *= 3600; break; /* Hours */<br>
                          case 'd': curtask->maxruntime *= 86400; break;        /* Days */<br>
                        }<br>
<br>
The pointer p is pointing to the first character after "MAXTIME ".  That's fine as long as it points to a numeric string.  If it doesn't point to a string of digits, tspec doesn't end up pointing to the multiplier, so MAXTIME is handled as seconds.<br>
<br>
Adding a space to the strspn string should fix it:<br>
<br>
       tspec = p + strspn(p, " 0123456789");<br>
<br>
Similarly, at line 254, for the INTERVAL option.<br>
</blockquote>
<br></span>
Hi,<br>
<br>
Yikes, yes we should definitely be more whitespace-tolerant here. It's possible this has been the root for occasional unexpected behavior over the years for some folks.</blockquote><br></div><div class="gmail_quote">That area in the code has not changed much since at least 4.3.12 - I diff'd 4.3.12 and 4.3.28 to see what might have changed to break it, because it seemed to work in 4.3.12.  Turns out I had used two spaces insstead of one....<br><br>You might want to throw in a \t as well, so it can tolerate tabs.<br><br></div><div class="gmail_quote">Ralph Mitchell<br><br></div></div></div>