check_snmp: Fix support for inverse thresholds
commit461cea42615936f0fdf9c75fa72d0fc0a88eaff6
authorHolger Weiss <holger@zedat.fu-berlin.de>
Wed, 21 Aug 2013 13:00:27 +0000 (21 15:00 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Wed, 21 Aug 2013 13:00:27 +0000 (21 15:00 +0200)
tree56289295ffb45802267cfee36ce73128f66f3a09
parentae8ff32eac1d04df77c73298afafc99471226d1b
check_snmp: Fix support for inverse thresholds

Commit bd782990566eec91b8312cfc2765a7e2bd9e67da reintroduced support for
inverse threshold ranges such as "2:1", but it broke standard thresholds
such as "1:2" (by converting this range into "1") or "1:" (by converting
this range into "@:2").  This commit fixes those two bugs, plus an
off-by-one error while computing the number of bytes to allocate when
handling inverse thresholds (two additional bytes were allocated where
three were required to hold '@' and ':' and '\0').  While at it, we also
check whether malloc(3) succeeded.
plugins/check_snmp.c