From: Florian Forster Date: Fri, 1 Jun 2007 16:06:52 +0000 (+0200) Subject: snmp plugin: Cast the `bitstring' to (char *). X-Git-Tag: collectd-4.1.0~66^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2608742b155472217a31b0781ab569926cbe54ba;hp=4a5e7a39a7a3ecbc009c85215608ecec970cedf1;p=collectd.git snmp plugin: Cast the `bitstring' to (char *). The implementation apparently differs between versions. --- diff --git a/src/snmp.c b/src/snmp.c index 6e15a61d..64f41ada 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -817,7 +817,7 @@ static int csnmp_read_table (struct snmp_session *sess_ptr, /* Get instance name */ if ((vb->type == ASN_OCTET_STR) || (vb->type == ASN_BIT_STR)) { - strncpy (il->instance, vb->val.bitstring, + strncpy (il->instance, (char *) vb->val.bitstring, sizeof (il->instance)); il->instance[sizeof (il->instance) - 1] = '\0'; DEBUG ("Before escape_slashes: %s", il->instance);