From: markus schnalke Date: Thu, 12 Nov 2015 07:14:59 +0000 (+0100) Subject: m_getfld2: Whitespace in component name is forbidden X-Git-Tag: mmh-0.3~39^2~17 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=d6321964322004b6fc7efbccbc97f92cee905ae7 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. --- 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) {