From bdf09270be2c5fb8a61b9e7f6bd0d0c194342000 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 30 Mar 2018 12:13:59 +0200 Subject: 42560: silence sign-compare compiler warnings --- Src/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Src') 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++; } -- cgit 1.4.1