diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-03-03 00:33:24 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-03-03 00:33:24 +0000 |
commit | 1773080631411d73af48e9a52939f975145cbf03 (patch) | |
tree | 931a90e199a2fb1fa25ae008b0eff96a01a265b0 /epan/ftypes/ftype-integer.c | |
parent | 13a2d273492e0d246868232071f4b4f4cd74f47b (diff) |
Fix some places where value-to-string routines were returning FALSE,
indicating an invalid string, but not reporting the error to the user.
svn path=/trunk/; revision=3098
Diffstat (limited to 'epan/ftypes/ftype-integer.c')
-rw-r--r-- | epan/ftypes/ftype-integer.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/epan/ftypes/ftype-integer.c b/epan/ftypes/ftype-integer.c index c2f494722f..c0da733cea 100644 --- a/epan/ftypes/ftype-integer.c +++ b/epan/ftypes/ftype-integer.c @@ -1,5 +1,5 @@ /* - * $Id: ftype-integer.c,v 1.4 2001/03/02 17:17:56 gram Exp $ + * $Id: ftype-integer.c,v 1.5 2001/03/03 00:33:24 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -63,15 +63,18 @@ val_from_string(fvalue_t *fv, char *s, LogFunc log) if (endptr == s || *endptr != '\0') { /* This isn't a valid number. */ - log("\"%s\" is not a valid number.", s); + if (log != NULL) + log("\"%s\" is not a valid number.", s); return FALSE; } if (errno == ERANGE) { - if (fv->value.integer == ULONG_MAX) { - log("\"%s\" causes an integer overflow.", s); - } - else { - log("\"%s\" is not an integer.", s); + if (log != NULL) { + if (fv->value.integer == ULONG_MAX) { + log("\"%s\" causes an integer overflow.", s); + } + else { + log("\"%s\" is not an integer.", s); + } } return FALSE; } @@ -85,7 +88,12 @@ ipxnet_from_string(fvalue_t *fv, char *s, LogFunc log) guint32 val; gboolean known; - if (val_from_string(fv, s, log)) { + /* + * Don't log a message if this fails; we'll try looking it + * up as an IPX network name if it does, and if that fails, + * we'll log a message. + */ + if (val_from_string(fv, s, NULL)) { return TRUE; } @@ -95,6 +103,7 @@ ipxnet_from_string(fvalue_t *fv, char *s, LogFunc log) return TRUE; } + log("\"%s\" is not a valid IPX network name or address.", s); return FALSE; } |