]> granicus.if.org Git - graphviz/commitdiff
simplify scanEntity with agxbprint
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Sep 2020 17:54:43 +0000 (10:54 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 17 Sep 2020 04:08:23 +0000 (21:08 -0700)
lib/common/utils.c

index 3aeac0c8f3590cd8bec996ba9f7d48fdf1087b0e..d891bae87cf6937bbfe0296a46ae8a64cc84d10b 100644 (file)
@@ -1365,10 +1365,7 @@ char* scanEntity (char* t, agxbuf* xb)
     res = bsearch(&key, entities, NR_OF_ENTITIES,
         sizeof(entities[0]), comp_entities);
     if (!res) return t;
-    sprintf (buf, "%d", res->value);
-    agxbputc(xb, '#');
-    agxbput(xb, buf);
-    agxbputc(xb, ';');
+    agxbprint(xb, "#%d;", res->value);
     return (endp+1);
 }