diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-05-01 14:57:16 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-05-01 14:57:16 +0000 |
commit | d378cbef6b531aacc9e1d02e136fc130a0688780 (patch) | |
tree | 3fc9bded2054db03793d8727d54e26a775ec5c59 /usr.bin | |
parent | ab0a66f7be5f1af5c9c716c9824378465df3c404 (diff) |
Exact match use and name with strcmp rather than prefix with strncmp.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/file/magic-load.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/file/magic-load.c b/usr.bin/file/magic-load.c index c07074cf015..51f4decde4e 100644 --- a/usr.bin/file/magic-load.c +++ b/usr.bin/file/magic-load.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magic-load.c,v 1.22 2016/05/01 10:56:03 nicm Exp $ */ +/* $OpenBSD: magic-load.c,v 1.23 2016/05/01 14:57:15 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -638,12 +638,12 @@ magic_parse_type(struct magic_line *ml, char **line) ml->type_operator = ' '; ml->type_operand = 0; - if (strncmp(s, "name", (sizeof "name") - 1) == 0) { + if (strcmp(s, "name") == 0) { ml->type = MAGIC_TYPE_NAME; ml->type_string = xstrdup(s); goto done; } - if (strncmp(s, "use", (sizeof "use") - 1) == 0) { + if (strcmp(s, "use") == 0) { ml->type = MAGIC_TYPE_USE; ml->type_string = xstrdup(s); goto done; |