Frédéric Bohé
2011-Jul-07 11:24 UTC
[Nut-upsdev] [nut-commits] svn commit r3128 - branches/nut-scanner/tools/nut-scanner
On Thu, 2011-07-07 at 09:42 +0000, Frederic BOHE wrote:> Author: fbohe-guest > Date: Thu Jul 7 09:42:26 2011 > New Revision: 3128 > URL: http://trac.networkupstools.org/projects/nut/changeset/3128 > > Log:I have fixed this empty log on the server. It should be : "Make sure the description string ends with a 0"> > > Modified: > branches/nut-scanner/tools/nut-scanner/scan_snmp.c > > Modified: branches/nut-scanner/tools/nut-scanner/scan_snmp.c > =============================================================================> --- branches/nut-scanner/tools/nut-scanner/scan_snmp.c Thu Jul 7 09:16:10 2011 (r3127) > +++ branches/nut-scanner/tools/nut-scanner/scan_snmp.c Thu Jul 7 09:42:26 2011 (r3128) > @@ -51,6 +51,7 @@ > struct snmp_session * session; > snmp_security_t * sec = (snmp_security_t *)arg; > int status; > + char * desc; > > while(snmp_device_table[index].oid != NULL) { > > @@ -95,8 +96,11 @@ > dev->type = TYPE_SNMP; > dev->driver = strdup("snmp-ups"); > dev->port = strdup(session->peername); > + desc = strndup((char*)response->variables->val.string, > + (int)response->variables->val_len); > add_option_to_device(dev,"desc", > (char*)response->variables->val.string); > + free(desc); > add_option_to_device(dev,"mibs",snmp_device_table[index].mib); > /* SNMP v3 */ > if( session->community == NULL || session->community[0] == 0) { > > _______________________________________________ > nut-commits mailing list > nut-commits at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-commits-- Team Open Source Eaton - http://powerquality.eaton.com --------------------------------------------------------------------------