From 5aff541ed26719c5985d134c747bccd3ebb38a4e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 21 Feb 2013 20:03:26 +0000 Subject: [PATCH 3/3] tests: Replace strchrnul() with strchr() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit strchrnul() doesn’t exist on FreeBSD, and it’s easy enough to replace it with strchr(). --- tests/modetest/modetest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index c91bb9d..336bb7e 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -860,7 +860,9 @@ static int parse_connector(struct connector *c, const char *arg) arg = endp + 1; - p = strchrnul(arg, '@'); + p = strchr(arg, '@'); + if (p == NULL) + p = arg + strlen(arg); len = min(sizeof c->mode_str - 1, p - arg); strncpy(c->mode_str, arg, len); c->mode_str[len] = '\0'; -- 1.7.11.7