diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-08-20 20:37:47 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-08-20 20:37:47 +0000 |
commit | f0e5afe7a981a9717cdd5d333a7dd41035104cbd (patch) | |
tree | 8e4c42561fafcb03407ef1ca45ceb8c3daae31ae /dfilter-grammar.y | |
parent | fa65ee1d1ed6894954c2782f76402b9a37c7d44e (diff) |
Enabled error reporting for bad ETHER values in display filters. A new
global variable, dfilter_error_msg is now available, being NULL when there
was no error, or pointing to a string when an error occurred. The three
places that dfilter_compile() is called now use this global variable to
report the error message to the user. A default error message is put
in that string if no context-specific error message is available (since
I only have one context-specifici error message, namely, ETHER values,
that will be most of the time).
svn path=/trunk/; revision=530
Diffstat (limited to 'dfilter-grammar.y')
-rw-r--r-- | dfilter-grammar.y | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/dfilter-grammar.y b/dfilter-grammar.y index 71900cf627..ba27f0e95e 100644 --- a/dfilter-grammar.y +++ b/dfilter-grammar.y @@ -3,7 +3,7 @@ /* dfilter-grammar.y * Parser for display filters * - * $Id: dfilter-grammar.y,v 1.11 1999/08/20 06:01:06 gram Exp $ + * $Id: dfilter-grammar.y,v 1.12 1999/08/20 20:37:45 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -514,10 +514,9 @@ dfilter_mknode_ether_value(gchar *byte_string) /* Rather than free the mem_chunk allocation, let it * stay. It will be cleaned up in the next call to * dfilter_clear() */ - if (global_df->error_sample) - g_free(global_df->error_sample); - global_df->error_sample = g_strdup(byte_string); - global_df->error = DFILTER_ERR_BAD_ETHER_VAL; + dfilter_error_msg = &dfilter_error_msg_buf[0]; + snprintf(dfilter_error_msg, sizeof(dfilter_error_msg_buf), + "\"%s\" is not a valid hardware address.", byte_string); return NULL; } |