From: Matthew Fernandez Date: Sun, 24 Jul 2022 17:05:08 +0000 (-0700) Subject: ast stresc: remove return value X-Git-Tag: 5.0.1~26^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88ab41d8026d36af6c74287319f541b5d7fe00de;p=graphviz ast stresc: remove return value The computation of the return value for this function was relying on string lengths that fitted in an `int`, something that is generally but not always true. The compiler complained about this with -Wconversion. The only caller of this function does not use the return value, so lets just remove it. --- diff --git a/lib/ast/ast.h b/lib/ast/ast.h index d53760a00..bbbdce44f 100644 --- a/lib/ast/ast.h +++ b/lib/ast/ast.h @@ -75,7 +75,7 @@ extern "C" { extern int strmatch(const char *, const char *); extern int strgrpmatch(const char *, const char *, int *, int, int); - extern int stresc(char *); + extern void stresc(char *); extern char *strcopy(char *s, const char *t); #ifdef __cplusplus diff --git a/lib/ast/stresc.c b/lib/ast/stresc.c index 0d8be317b..75c2d118d 100644 --- a/lib/ast/stresc.c +++ b/lib/ast/stresc.c @@ -13,19 +13,17 @@ * AT&T Bell Laboratories * * convert \x character constants in s in place - * the length of the converted s is returned (may have imbedded \0's) */ #include -int stresc(char *s) +void stresc(char *s) { char *t; int c; - char *b; char *p; - b = t = s; + t = s; for (;;) { switch (c = *s++) { case '\\': @@ -34,7 +32,7 @@ int stresc(char *s) break; case 0: *t = 0; - return (t - b); + return; } *t++ = c; }