From: Matthew Fernandez Date: Sat, 15 Jan 2022 18:16:27 +0000 (-0800) Subject: lefty: use a C99 bool instead of int for 'htmlflag' in 'writeattr' X-Git-Tag: 3.0.0~66^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b406f0a11f51cae18e6a0a798b4d030a8b3111b;p=graphviz lefty: use a C99 bool instead of int for 'htmlflag' in 'writeattr' --- diff --git a/cmd/lefty/dot2l/dot2l.c b/cmd/lefty/dot2l/dot2l.c index 202c332e0..e6a4108bf 100644 --- a/cmd/lefty/dot2l/dot2l.c +++ b/cmd/lefty/dot2l/dot2l.c @@ -14,6 +14,7 @@ #include "code.h" #include "tbl.h" #include "dot2l.h" +#include extern void lex_begin (int); @@ -455,7 +456,7 @@ static void writesgraph (int ioi, Tobj graph, int gn, int nn, char *buf) { static void writeattr (int ioi, Tobj to, char *buf) { Tkvindex_t tkvi; char *s1, *s2, *s3; - int htmlflag; + bool htmlflag; s1 = buf + strlen (buf); for (Tgetfirst (to, &tkvi); tkvi.kvp; Tgetnext (&tkvi)) { @@ -479,12 +480,12 @@ static void writeattr (int ioi, Tobj to, char *buf) { sprintf (s2, "\"%lf\"", Tgetreal (tkvi.kvp->vo)); break; case T_STRING: - *s2++ = '"', htmlflag = FALSE; + *s2++ = '"', htmlflag = false; if ( *(s3 = Tgetstring (tkvi.kvp->vo)) == '>' && s3[strlen (s3) - 1] == '<' ) - *(s2 - 1) = '<', s3++, htmlflag = TRUE; + *(s2 - 1) = '<', s3++, htmlflag = true; for ( ; *s3; s3++) if (!htmlflag && *s3 == '"') *s2++ = '\\', *s2++ = *s3;