On 06/24/2010 06:01 PM, Dave Shield wrote: > On 24 June 2010 15:19, Magnus Fromreide<ma...@lysator.liu.se> wrote: >>> I suspect that what is probably needed is some form of flag within the >>> range_list structure, to indicate whether the values should be treated as >>> signed or unsigned (with appropriate casts if necessary). >> >> There already is a flag. Not in the range_list structure but in the >> associated >> type declaration. It is named 'type'. > > Yup - that would work. > The type is certainly available to the _check_range call, so could be used > there. The 'parse_range' routine doesn't currently have access to the > syntax of the object being parsed, but this is a purely private internal API > (defined 'static') within parse.c, so could easily be tweaked to include this > information.
It is enough to fix _check_range to fix this bug (snmptranslate printing wrong ranges). I've just checked it in, SVN rev. 19095. It seems to me the parsing in parse_ranges works, although it looks completelly crazy (using stroul for parsing signed values...). I pretend I haven't seen it and add it to the bottom of my TODO list... Jan ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders