about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2006-01-09 17:44:02 +0000
committerWayne Davison <wayned@users.sourceforge.net>2006-01-09 17:44:02 +0000
commitcc890edcb58683943a3af0e7e0d53a42496acd28 (patch)
tree18b715230239bf519900715d923cfe9b955dc33a /Src/utils.c
parent90f7b1e17337334ffa7c930a42539ae5cc5049e0 (diff)
downloadzsh-cc890edcb58683943a3af0e7e0d53a42496acd28.tar.gz
zsh-cc890edcb58683943a3af0e7e0d53a42496acd28.tar.xz
zsh-cc890edcb58683943a3af0e7e0d53a42496acd28.zip
Changed the name of the "ret" variable in mb_niceformat() to "cnt"
because "ret" is usually used for a variable name to hold the
return value of the function.  Also, changed the test when
checking for a \0 to one that checks if "cnt" is 0, since we
must always change a value of 0 to 1.
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 84e2d6848..3882a22ab 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3446,7 +3446,7 @@ niceztrlen(char const *s)
 mod_export size_t
 mb_niceformat(const char *s, FILE *stream, char **outstrp, int heap)
 {
-    size_t l = 0, newl, ret;
+    size_t l = 0, newl;
     int umlen, outalloc, outleft;
     wchar_t c;
     char *ums, *ptr, *fmt, *outstr, *outptr;
@@ -3471,25 +3471,25 @@ mb_niceformat(const char *s, FILE *stream, char **outstrp, int heap)
 
     memset(&ps, 0, sizeof(ps));
     while (umlen > 0) {
-	ret = mbrtowc(&c, ptr, umlen, &ps);
+	size_t cnt = mbrtowc(&c, ptr, umlen, &ps);
 
-	if (ret != (size_t)-1 && ret != (size_t)-2) {
+	if (cnt != (size_t)-1 && cnt != (size_t)-2) {
 	    /* Careful:  converting '\0' returns 0, but a '\0' is a
 	     * real character for us, so we should consume 1 byte. */
-	    if (c == L'\0')
-		ret = 1;
+	    if (cnt == 0)
+		cnt = 1;
 	    fmt = wcs_nicechar(c, &newl, NULL);
 	} else {
 	    /* The byte didn't convert, so output it as a \M-... sequence. */
 	    fmt = nicechar(STOUC(*ptr));
 	    newl = strlen(fmt);
-	    ret = 1;
+	    cnt = 1;
 	    /* Get ps out of its undefined state. */
 	    memset(&ps, 0, sizeof ps);
 	}
 
-	umlen -= ret;
-	ptr += ret;
+	umlen -= cnt;
+	ptr += cnt;
 	l += newl;
 
 	if (stream)