diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-10-22 08:02:21 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-10-22 08:02:21 +0000 |
commit | d9e7aca79ec35b879a6299e40f7fa690dc50c1ad (patch) | |
tree | d53102776ad6f095f3ec7924795ad867ae89161a /ipproto.c | |
parent | 047b8751f369c1e466d1264afa03ac3d49ec54e1 (diff) | |
download | wireshark-d9e7aca79ec35b879a6299e40f7fa690dc50c1ad.tar.gz wireshark-d9e7aca79ec35b879a6299e40f7fa690dc50c1ad.tar.bz2 wireshark-d9e7aca79ec35b879a6299e40f7fa690dc50c1ad.zip |
If one wants to look up a value in a "value_string" table, and get back
either the corresponding string on success or NULL on failure, one
should use "match_strval()", rather than using "val_to_str()" with a
null format - "val_to_str()" uses the format if the lookup fails, so it
won't work correctly (e.g., it may drop core) if the format string is
NULL.
svn path=/trunk/; revision=910
Diffstat (limited to 'ipproto.c')
-rw-r--r-- | ipproto.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,7 +1,7 @@ /* ipproto.c * Routines for converting IPv4 protocol/v6 nxthdr field into string * - * $Id: ipproto.c,v 1.2 1999/10/15 05:30:35 itojun Exp $ + * $Id: ipproto.c,v 1.3 1999/10/22 08:02:21 guy Exp $ * * Gilbert Ramirez <gram@verdict.uthscsa.edu> * @@ -98,7 +98,7 @@ const char *ipprotostr(int proto) { struct protoent *pe; #endif - if ((s = val_to_str(proto, ipproto_val, NULL)) != NULL) + if ((s = match_strval(proto, ipproto_val)) != NULL) goto ok; #ifdef HAVE_GETPROTOBYNUMBER |