You need to put a
break statement after each
case block, so that the compiler knows to exit the
switch block. Otherwise, execution will "fall" through all of the remaining
case blocks to the end of the
switch block.
Code:
printf("snmp_fetch_oid_value: To response->errstat einai %ld \n",response->errstat);
switch(response->errstat)
{
case (SNMP_ERR_TOOBIG):
printf("Too big messange \n");
break;
case (SNMP_ERR_NOSUCHNAME):
printf("No such name idiot \n");
break;
case (SNMP_ERR_BADVALUE):
printf("Bad value \n");
break;
case (SNMP_ERR_READONLY):
printf("Read only value \n");
break;
case (SNMP_ERR_GENERR):
printf("Generic error \n");
break;
default:
printf("Everything is fine \n");
}
~sind