From d8c9887dea66d68d066b31c2f0542c95170fb328 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 6 Sep 2020 09:50:12 -0700 Subject: [PATCH] simplify getObjId with agxbprint --- lib/common/emit.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index b84496413..b9b333316 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -199,7 +199,6 @@ getObjId (GVJ_t* job, void* obj, agxbuf* xb) char* gid = GD_drawing(root)->id; long idnum = 0; char* pfx = NULL; - char buf[64]; /* large enough for a decimal 64-bit int */ layerPagePrefix (job, xb); @@ -210,8 +209,7 @@ getObjId (GVJ_t* job, void* obj, agxbuf* xb) } if ((obj != root) && gid) { - agxbput (xb, gid); - agxbputc (xb, '_'); + agxbprint (xb, "%s_", gid); } switch (agobjkind(obj)) { @@ -232,9 +230,7 @@ getObjId (GVJ_t* job, void* obj, agxbuf* xb) break; } - agxbput (xb, pfx); - sprintf (buf, "%ld", idnum); - agxbput (xb, buf); + agxbprint (xb, "%s%ld", pfx, idnum); return agxbuse(xb); } -- 2.40.0