Rich,

Thanks for submitting this patch.

One small thing I noticed on the Solaris buildbot:

../../drivers/bcmxcp.c: In function `setvar':
../../drivers/bcmxcp.c:1733: warning: comparison is always false due to limited range of data type
The code:
int setvar (const char *varname, const char *val)
{
[...]
int16_t sec; /* limit the size of the timer, to avoid overflow */
[...]
        sec = atoi(val);
        /* Check value:
         *      0-32767 are valid values
         *      -1 means no Automatic off or restart
         * for Auto Off Delay:
         *      0-30 are valid but ill-advised */
        if (sec < -1 || sec > 0x7FFF) {
                return STAT_SET_INVALID;
        }

I think the value of atoi() should probably be assigned to a larger int variable, and leave the conditional there to guard against out-of- range values.
_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to