From: Federico Kircheis Date: Sat, 29 Jun 2019 12:11:54 +0000 (+0200) Subject: Replace `try` variable with `user` X-Git-Tag: 2019-10-25~149^2~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9835f7f2b6498cea0a809cdf132c5c38b395c620;p=neomutt Replace `try` variable with `user` `try` is a keyword in c++ While this should not affect C code, it affects unfortunately the tooling. This specific instance triggers a "syntax error" in Cppcheck, so it could hide other problems. (Cppcheck version 1.86, code parsed with `--language=c --std=c99`) Of course it is a bug in Cppcheck, but renaming the variable is the most pragmatic approach, as the bug in Cppcheck does not manifest itself in a simple program. --- diff --git a/init.c b/init.c index c10d30158..04dddc5cd 100644 --- a/init.c +++ b/init.c @@ -177,19 +177,19 @@ static void matches_ensure_morespace(int current) /** * candidate - helper function for completion - * @param try User entered data for completion + * @param user User entered data for completion * @param src Candidate for completion * @param dest Completion result gets here * @param dlen Length of dest buffer * * Changes the dest buffer if necessary/possible to aid completion. */ -static void candidate(char *try, const char *src, char *dest, size_t dlen) +static void candidate(char *user, const char *src, char *dest, size_t dlen) { - if (!dest || !try || !src) + if (!dest || !user || !src) return; - if (strstr(src, try) != src) + if (strstr(src, user) != src) return; matches_ensure_morespace(NumMatched);