]> granicus.if.org Git - graphviz/commitdiff
remove unnecessary realloc result cast in gmlscan.l
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 4 Jun 2021 00:21:07 +0000 (17:21 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 9 Jun 2021 14:18:52 +0000 (07:18 -0700)
This input is only used to generate a lexer in C. In C, void pointers (as is the
result of realloc) implicitly coerce to all other pointer types.

cmd/tools/gmlscan.l

index 41fb16aa4ce63878ce6d24a09bdecd4289461a6d..a04c8b71fa7fc74a230fa5f2159662d706cf45b4 100644 (file)
@@ -62,7 +62,7 @@ static void addstr(char *src)
            long    sz = Send - Sbuf;
            long    off = Sptr - Sbuf;
            sz *= 2;
-           Sbuf = (char*)realloc(Sbuf,sz);
+           Sbuf = realloc(Sbuf,sz);
            Send = Sbuf + sz;
            Sptr = Sbuf + off;
        }