summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasper <jasper@openbsd.org>2015-11-09 11:44:00 +0000
committerjasper <jasper@openbsd.org>2015-11-09 11:44:00 +0000
commit026ff01bd2eacfe085acb231afe932256c3c5b6c (patch)
tree2514e7e3cd1c847f1b9953daf17660c584a43cd5
parentMatch recent rtalloc(9) rewrite. (diff)
downloadwireguard-openbsd-026ff01bd2eacfe085acb231afe932256c3c5b6c.tar.xz
wireguard-openbsd-026ff01bd2eacfe085acb231afe932256c3c5b6c.zip
use strncasecmp()
ok lum@
-rw-r--r--usr.bin/mg/echo.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/usr.bin/mg/echo.c b/usr.bin/mg/echo.c
index 6bfdea266de..e6143f36170 100644
--- a/usr.bin/mg/echo.c
+++ b/usr.bin/mg/echo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: echo.c,v 1.62 2015/11/09 07:52:18 jasper Exp $ */
+/* $OpenBSD: echo.c,v 1.63 2015/11/09 11:44:00 jasper Exp $ */
/* This file is in the public domain. */
@@ -132,14 +132,9 @@ eyesno(const char *sp)
maclcur->l_fp = lp->l_fp;
free(lp);
}
- if ((rep[0] == 'y' || rep[0] == 'Y') &&
- (rep[1] == 'e' || rep[1] == 'E') &&
- (rep[2] == 's' || rep[2] == 'S') &&
- (rep[3] == '\0'))
+ if (strncasecmp(rep, "yes", sizeof(rep)) == 0)
return (TRUE);
- if ((rep[0] == 'n' || rep[0] == 'N') &&
- (rep[1] == 'o' || rep[0] == 'O') &&
- (rep[2] == '\0'))
+ if (strncasecmp(rep, "no", sizeof(rep)) == 0)
return (FALSE);
}
rep = eread("Please answer yes or no. %s? (yes or no) ",