From cb5584707501db42ed2538f59ff99b43b3c460a9 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 25 Jul 2021 10:34:10 -0700 Subject: [PATCH] ccomps: use a size_t when dealing with character offsets in split Squashes a -Wconversion and a -Wsign-conversion warning. --- cmd/tools/ccomps.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/tools/ccomps.c b/cmd/tools/ccomps.c index 7b466b3a2..ad5110348 100644 --- a/cmd/tools/ccomps.c +++ b/cmd/tools/ccomps.c @@ -133,12 +133,11 @@ static void usage(int v) static void split(char *name) { char *sfx = 0; - int size; sfx = strrchr(name, '.'); if (sfx) { suffix = sfx + 1; - size = sfx - name; + size_t size = (size_t)(sfx - name); path = xmalloc(size + 1); strncpy(path, name, size); *(path + size) = '\0'; -- 2.40.0