]> granicus.if.org Git - graphviz/commitdiff
agwrite: [nfc] separate assignment from conditional
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 25 Feb 2022 15:59:14 +0000 (07:59 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 27 Feb 2022 21:12:12 +0000 (13:12 -0800)
Squashes an MSVC “warning C4706: assignment within conditional expression”
warning.

lib/cgraph/write.c

index e0e2cdda87cd459285efeaf5186f5fe26da4f300..d7c46f9dda7ee61adaef723a00c9521c34423f7c 100644 (file)
@@ -657,7 +657,8 @@ int agwrite(Agraph_t * g, void *ofile)
     char* s;
     int len;
     Level = 0;                 /* re-initialize tab level */
-    if ((s = agget(g, "linelength")) && isdigit((int)*s)) {
+    s = agget(g, "linelength");
+    if (s != NULL && isdigit((int)*s)) {
        len = (int)strtol(s, (char **)NULL, 10);
        if (len == 0 || len >= MIN_OUTPUTLINE)
            Max_outputline = len;