commit 71236e145d4b6f40c87839dd1b26c28f38263c23
parent 7be76af418c923095d9cdebe67abc5d2f063fe41
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 9 Jun 2019 11:08:34 +0200
tweaks: rename two variables, away from a single letter
And adjust the indentation after the previous change.
Diffstat:
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/chars.c b/src/chars.c
@@ -504,22 +504,22 @@ char *mbrevstrcasestr(const char *haystack, const char *needle,
}
/* Count the number of (multibyte) characters in the given string. */
-size_t mbstrlen(const char *s)
+size_t mbstrlen(const char *pointer)
{
- size_t n = 0;
+ size_t count = 0;
- while (*s != '\0') {
- if ((signed char)*s < 0) {
- int length = mblen(s, MAXCHARLEN);
+ while (*pointer != '\0') {
+ if ((signed char)*pointer < 0) {
+ int length = mblen(pointer, MAXCHARLEN);
- s += (length < 0 ? 1 : length);
- } else
- s++;
+ pointer += (length < 0 ? 1 : length);
+ } else
+ pointer++;
- n++;
- }
+ count++;
+ }
- return n;
+ return count;
}
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)