From bb8f40989fa558ec1cfcf321582993856654a7b9 Mon Sep 17 00:00:00 2001 From: Hussam al-Homsi Date: Sat, 2 Oct 2021 00:55:17 -0400 Subject: [PATCH] tweaks: change 'return ++var;' to 'return var + 1;' This avoids an unused and misleading assignment that might make someone think the incremented variable will be used again. Signed-off-by: Hussam al-Homsi --- src/text.c | 2 +- src/utils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/text.c b/src/text.c index 0dfe5500..98248c54 100644 --- a/src/text.c +++ b/src/text.c @@ -186,7 +186,7 @@ size_t length_of_white(const char *text) while (TRUE) { if (*text == '\t') - return ++white_count; + return white_count + 1; if (*text != ' ') return white_count; diff --git a/src/utils.c b/src/utils.c index 09abe336..e5ec6337 100644 --- a/src/utils.c +++ b/src/utils.c @@ -61,7 +61,7 @@ const char *tail(const char *path) if (slash == NULL) return path; else - return ++slash; + return slash + 1; } /* Return a copy of the two given strings, welded together. */