summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-12-05 02:14:03 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-12-05 02:14:03 +0000
commitf7a80018fdab7bcc5e4f26df5368bd009d298d21 (patch)
treeecf858a9ec3facba22027e4854a0544378dcf4c4 /usr.bin
parent309d04c0e3085c745391c9fefd4fcf9b70a916e0 (diff)
Fix an incorrect use of sizeof(pointer) by removing it and switching
from strncasecmp to strcasecmp which will stop matching strings with unwanted trailing characters. ok jasper@ deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/echo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mg/echo.c b/usr.bin/mg/echo.c
index f47236a0a61..d3746d12f5c 100644
--- a/usr.bin/mg/echo.c
+++ b/usr.bin/mg/echo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: echo.c,v 1.64 2015/11/11 08:52:12 lum Exp $ */
+/* $OpenBSD: echo.c,v 1.65 2015/12/05 02:14:02 jsg Exp $ */
/* This file is in the public domain. */
@@ -148,11 +148,11 @@ eyesno(const char *sp)
maclcur->l_fp = lp->l_fp;
free(lp);
}
- if (strncasecmp(rep, "yes", sizeof(rep)) == 0) {
+ if (strcasecmp(rep, "yes") == 0) {
ewprintf("");
return (TRUE);
}
- if (strncasecmp(rep, "no", sizeof(rep)) == 0) {
+ if (strcasecmp(rep, "no") == 0) {
ewprintf("");
return (FALSE);
}