From: Matthew Fernandez Date: Fri, 25 Feb 2022 15:59:14 +0000 (-0800) Subject: agwrite: [nfc] separate assignment from conditional X-Git-Tag: 4.0.0~205^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edaab9b4522e9dd8e2e4552cc9e96fca20937e0c;p=graphviz agwrite: [nfc] separate assignment from conditional Squashes an MSVC “warning C4706: assignment within conditional expression” warning. --- diff --git a/lib/cgraph/write.c b/lib/cgraph/write.c index e0e2cdda8..d7c46f9dd 100644 --- a/lib/cgraph/write.c +++ b/lib/cgraph/write.c @@ -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;