summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2018-03-30 12:13:59 +0200
committerOliver Kiddle <okiddle@yahoo.co.uk>2018-03-30 12:13:59 +0200
commitbdf09270be2c5fb8a61b9e7f6bd0d0c194342000 (patch)
treeeb39142d23f09db7116bef4ca96824bb0336d868 /Src
parent36e8471a2c888a693ebcce4b39da2764b1475f56 (diff)
downloadzsh-bdf09270be2c5fb8a61b9e7f6bd0d0c194342000.tar.gz
zsh-bdf09270be2c5fb8a61b9e7f6bd0d0c194342000.tar.xz
zsh-bdf09270be2c5fb8a61b9e7f6bd0d0c194342000.zip
42560: silence sign-compare compiler warnings
Diffstat (limited to 'Src')
-rw-r--r--Src/utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Src/utils.c b/Src/utils.c
index eab407eee..3587c3622 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -4396,7 +4396,7 @@ spname(char *oldname)
      * Rationale for this, if there ever was any, has been forgotten.    */
     for (;;) {
 	while (*old == '/') {
-	    if ((new - newname) >= (sizeof(newname)-1))
+            if (new >= newname + sizeof(newname) - 1)
 		return NULL;
 	    *new++ = *old++;
 	}
@@ -4427,7 +4427,7 @@ spname(char *oldname)
 	    if (bestdist < maxthresh) {
 		struncpy(&new, spnameguess, sizeof(newname) - (new - newname));
 		struncpy(&new, old, sizeof(newname) - (new - newname));
-		return (new - newname) >= (sizeof(newname)-1) ? NULL : newname;
+		return (new >= newname + sizeof(newname) -1) ? NULL : newname;
 	    } else
 	    	return NULL;
 	} else {
@@ -4435,7 +4435,7 @@ spname(char *oldname)
 	    bestdist += thisdist;
 	}
 	for (p = spnamebest; (*new = *p++);) {
-	    if ((new - newname) >= (sizeof(newname)-1))
+	    if (new >= newname + sizeof(newname) - 1)
 		return NULL;
 	    new++;
 	}