From d6321964322004b6fc7efbccbc97f92cee905ae7 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Thu, 12 Nov 2015 08:14:59 +0100 Subject: [PATCH] m_getfld2: Whitespace in component name is forbidden Also on style: No function calls should be used to initialize variables in definition statements. Use separate assignments in this case. --- sbr/m_getfld2.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sbr/m_getfld2.c b/sbr/m_getfld2.c index 91164f3..a17eb03 100644 --- a/sbr/m_getfld2.c +++ b/sbr/m_getfld2.c @@ -175,11 +175,17 @@ static size_t copyname(char *dst, char *src) { size_t len; - char *sep = strchr(src, ':'); + char *cp, *sep; - if (!sep) { + if (!(sep = strchr(src, ':'))) { return 0; } + /* whitespace is forbidden in name */ + for (cp=src; cp= NAMESZ) { -- 1.7.10.4