]> granicus.if.org Git - graphviz/commitdiff
pathcanon: remove some int-as-char type confusion
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 12 Aug 2021 02:13:57 +0000 (19:13 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 14 Aug 2021 00:27:59 +0000 (17:27 -0700)
Removes a -Wconversion warning.

lib/ast/pathcanon.c

index ae7ef34f0a6aeb7b95915156af07f600bd57c06e..d75568fdd290257fb2a3ac8558d862c7e2200c27 100644 (file)
@@ -125,11 +125,10 @@ char *pathcanon(char *path, int flags)
                break;
            default:
                if ((flags & PATH_PHYSICAL) && loop < 32 && (t - 1) > path) {
-                   int c;
                    char buf[PATH_MAX];
 
-                   c = *(t - 1);
-                   *(t - 1) = 0;
+                   char c = *(t - 1);
+                   *(t - 1) = '\0';
                    size_t len = pathgetlink(phys, buf, sizeof(buf));
                    *(t - 1) = c;
                    if (len != SIZE_MAX && len > 0) {