On 16/01/07, Alef Veld <[EMAIL PROTECTED]> wrote:
> I now use this code to get the timeticks, but i only gets 4 bytes (char)
> The 8 extra allocated bytes were a desperate attempt to get more digits
> but alas, that does not work. I still only get 4 digits.

You will only *ever* get 4 bytes.
As we've said, TimeTicks is a 32-bit value - i.e. 4 bytes.
You can't make it any longer.

But it's 4 *binary* bytes, not 4 printable characters.


Try:

>  if(vars->type==ASN_TIMETICKS) {
>  if(i==1) {
>      data->sysUpTimeInt= *vars->val.integer;

where 'sysUpTimeInt' is an integer (long) variable.

If you want this converted into a printable representation
try something like:

    data->sysUpTime = malloc( N );
    snprintf_value( data->sysUpTime, N,
                             vars->name, vars->name_length, vars);

(for some suitable value of N)

Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to