summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2016-10-07 07:37:29 +0000
committerpatrick <patrick@openbsd.org>2016-10-07 07:37:29 +0000
commit11b123fb2c9741a29a7871f1060c0394ecbb8ab6 (patch)
tree965c3a7dd2c348d85ce76a12d9387b933a73085d
parentEmpty lines cause server_fcgi_getheaders() to immediately return. (diff)
downloadwireguard-openbsd-11b123fb2c9741a29a7871f1060c0394ecbb8ab6.tar.xz
wireguard-openbsd-11b123fb2c9741a29a7871f1060c0394ecbb8ab6.zip
The strchr() call either returns a NULL pointer, on which the code will
break out of the loop, or a pointer to ':'. Thus the extra check for ':' is unnecessary and can be removed. ok jung@
-rw-r--r--usr.sbin/httpd/server_fcgi.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/httpd/server_fcgi.c b/usr.sbin/httpd/server_fcgi.c
index ad74aec705e..fc3e417ee28 100644
--- a/usr.sbin/httpd/server_fcgi.c
+++ b/usr.sbin/httpd/server_fcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server_fcgi.c,v 1.72 2016/10/07 07:33:54 patrick Exp $ */
+/* $OpenBSD: server_fcgi.c,v 1.73 2016/10/07 07:37:29 patrick Exp $ */
/*
* Copyright (c) 2014 Florian Obser <florian@openbsd.org>
@@ -769,12 +769,9 @@ server_fcgi_getheaders(struct client *clt)
if ((value = strchr(key, ':')) == NULL)
break;
- if (*value == ':') {
- *value++ = '\0';
- value += strspn(value, " \t");
- } else {
- *value++ = '\0';
- }
+
+ *value++ = '\0';
+ value += strspn(value, " \t");
DPRINTF("%s: %s: %s", __func__, key, value);