[Nut-upsdev] Suspicious strcasecmp()

Kiss Gabor (Bitman) kissg at ssg.ki.iif.hu
Wed Oct 7 11:55:48 UTC 2009


In drivers/snmp-ups.c:

                if (strcasecmp(cmdname, "shutdown.return")) {
                        ret = su_setvar("ups.delay.start", extradata);
                }
                if (strcasecmp(cmdname, "shutdown.stayoff")) {
                        ret = su_setvar("ups.delay.shutdown", extradata);
                }
                if (strcasecmp(cmdname, "shutdown.reboot")) {
                        ret = su_setvar("ups.delay.reboot", extradata);
                }

I think return value of strcasecmp() should be negated.

Gabor



More information about the Nut-upsdev mailing list