From c9b31427b48989a5c225b940497a55c5113a3769 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 6 Nov 2012 16:40:06 -0800 Subject: [PATCH] sim_defs.h - Make MATCH_CMD match at least one character instead of having an empty string match everything --- sim_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim_defs.h b/sim_defs.h index fbc3b4ec..8aa2d94c 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -275,9 +275,9 @@ typedef uint32 t_addr; #define SWMASK(x) (1u << (((int) (x)) - ((int) 'A'))) -/* String match */ +/* String match - at least one character required */ -#define MATCH_CMD(ptr,cmd) strncmp ((ptr), (cmd), strlen (ptr)) +#define MATCH_CMD(ptr,cmd) (*(ptr) && strncmp ((ptr), (cmd), strlen (ptr))) /* End of Linked List/Queue value */ /* Chosen for 2 reasons: */