On 10/01/07, Wilson, Dave <[EMAIL PROTECTED]> wrote:
> Thanks Dave, but
>
> "
>> Use exactly the same test as above:
>>
>>      case STATSVALUE:
>>          if ( strlen(tempPTR->Name) == 0 ) return NULL;      <====
>>          long_ret = tempPTR->Value;
>>          return (unsigned char *) &long_ret; "
>
> tempPTR->Name is not a string, it's an integer.

Eh?
I took that from your original code fragment (STATSNAME)
where you were definitely using it as a string.

I'd assumed that 'tempPTR' was a pointer to the data structure
holding one row of the table.  Something of the form:

   struct  myRow {
       int   Index;
       char*  Name;
       int       Value;
   }

So before returning the (integer) 'tempPTR->Value',
you'd check that the (string) 'tempPTR->Name' is valid.

If that's not how the data is structured, then you'll need to
give a bit more detail before we can offer sensible advice.

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-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to