diff options
Diffstat (limited to 'wiretap/daintree-sna.c')
-rw-r--r-- | wiretap/daintree-sna.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/wiretap/daintree-sna.c b/wiretap/daintree-sna.c index dfb51c27a3..3deca1dff7 100644 --- a/wiretap/daintree-sna.c +++ b/wiretap/daintree-sna.c @@ -62,10 +62,9 @@ typedef struct daintree_sna_header { #define DAINTREE_SNA_HEADER_SIZE 2 #define FCS_LENGTH 2 -static const char daintree_magic_text[] = -{ '#', 'F', 'o', 'r', 'm', 'a', 't', '=' }; +static const char daintree_magic_text[] = "#Format="; -#define DAINTREE_MAGIC_TEXT_SIZE (sizeof daintree_magic_text) +#define DAINTREE_MAGIC_TEXT_SIZE (sizeof daintree_magic_text - 1) #define DAINTREE_MAX_LINE_SIZE 512 #define READDATA_BUF_SIZE (DAINTREE_MAX_LINE_SIZE/2) #define READDATA_MAX_FIELD_SIZE "255" /* DAINTREE_MAX_LINE_SIZE/2 -1 */ @@ -95,8 +94,7 @@ wtap_open_return_val daintree_sna_open(wtap *wth, int *err, gchar **err_info) } /* check magic text */ - if (strlen(readLine) >= DAINTREE_MAGIC_TEXT_SIZE && - memcmp(readLine, daintree_magic_text, DAINTREE_MAGIC_TEXT_SIZE) != 0) + if (strncmp(readLine, daintree_magic_text, DAINTREE_MAGIC_TEXT_SIZE) != 0) return WTAP_OPEN_NOT_MINE; /* not daintree format */ /* read second header line */ |