From 2abff4ef8b51c95c167da232c2a36710003be62c Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 4 Dec 1999 21:32:58 +0000 Subject: [PATCH] Oops! First check if the short name in the "dump_open_table[]" entry is NULL before checking if it matches the name you were handed.... svn path=/trunk/; revision=1208 --- wiretap/file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wiretap/file.c b/wiretap/file.c index e45b61c6ad..0c365d2603 100644 --- a/wiretap/file.c +++ b/wiretap/file.c @@ -1,6 +1,6 @@ /* file.c * - * $Id: file.c,v 1.36 1999/12/04 21:20:09 guy Exp $ + * $Id: file.c,v 1.37 1999/12/04 21:32:58 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez @@ -276,7 +276,8 @@ int wtap_short_string_to_file_type(const char *short_name) int filetype; for (filetype = 0; filetype < WTAP_NUM_FILE_TYPES; filetype++) { - if (strcmp(short_name, dump_open_table[filetype].short_name) == 0) + if (dump_open_table[filetype].short_name != NULL && + strcmp(short_name, dump_open_table[filetype].short_name) == 0) return filetype; } return -1; /* no such file type, or we can't write it */