Re: Dynmically retrieving only objects with real values?

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.