Menu

#1 snmptranslate.c (v1.0): optind not reset to 1 between calls

v1.0 (example)
open
nobody
None
5
2008-03-11
2008-03-11
No

On version 1.0, global optind is not reset to 1 before calling getopt() in snmptranslate().

This results in "snmp translate" failing in subsequent calls, because getopt() runs out of arguments to parse (possibly resulting in a core dumped).

Simply adding a

optind = 1;

before the call to getopt() seems to work.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.