sim_defs.h - Make MATCH_CMD match at least one character instead of having an empty string match everything

This commit is contained in:
Mark Pizzolato 2012-11-06 16:40:06 -08:00
parent 3e78dc6732
commit c9b31427b4

View file

@ -275,9 +275,9 @@ typedef uint32 t_addr;
#define SWMASK(x) (1u << (((int) (x)) - ((int) 'A'))) #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 */ /* End of Linked List/Queue value */
/* Chosen for 2 reasons: */ /* Chosen for 2 reasons: */