From 262580f1d5d70b258138926e1304d5d0c7e5f77d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 6 Jan 2017 21:37:52 +0100 Subject: [PATCH] gcc warning eliminated --- src/report.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/report.c b/src/report.c index 0d6d283dd..0c7697fe5 100644 --- a/src/report.c +++ b/src/report.c @@ -413,9 +413,10 @@ void nr_spell_syntax(struct stream *out, spellbook_entry * sbe, const struct loc } else { char substr[32]; - assert(sizeof(substr) > (cstr - syntaxp)); - memcpy(substr, syntaxp, cstr - syntaxp); - substr[cstr - syntaxp] = 0; + size_t len = cstr - syntaxp; + assert(sizeof(substr) > len); + memcpy(substr, syntaxp, len); + substr[len] = 0; locp = LOC(lang, mkname("spellpar", substr)); syntaxp = substr + 1; }