]> granicus.if.org Git - graphviz/commitdiff
simplify initAnchor with agxbprint
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Sep 2020 16:55:53 +0000 (09:55 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 17 Sep 2020 04:08:23 +0000 (21:08 -0700)
lib/common/htmltable.c

index 39750dac99ca7e093b07590f6dc87694114977c5..a01fd8bf11834a0e60d5ca88fdfca92d451f4821 100644 (file)
@@ -379,7 +379,6 @@ initAnchor(GVJ_t * job, htmlenv_t * env, htmldata_t * data, boxf b,
     static int anchorId;
     int internalId = 0;
     agxbuf xb;
-    char intbuf[30];           /* hold 64-bit decimal integer */
     unsigned char buf[SMALLBUF];
 
     save->url = obj->url;
@@ -394,9 +393,7 @@ initAnchor(GVJ_t * job, htmlenv_t * env, htmldata_t * data, boxf b,
            env->objid = strdup(getObjId(job, obj->u.n, &xb));
            env->objid_set = 1;
        }
-       agxbput(&xb, env->objid);
-       sprintf(intbuf, "_%d", anchorId++);
-       agxbput(&xb, intbuf);
+       agxbprint(&xb, "%s_%d", env->objid, anchorId++);
        id = agxbuse(&xb);
        internalId = 1;
     }