summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/psm.c5
-rw-r--r--lib/rpmts.c4
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 70f0c2a9e..8179b6432 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -125,7 +125,7 @@ const char ** argv;
const char * str;
int32_t * i32p;
} body;
- char numbuf[32];
+ char *numbuf = NULL;
rpmTagType type;
for (tagm = tagMacros; tagm->macroname != NULL; tagm++) {
@@ -133,8 +133,9 @@ const char ** argv;
continue;
switch (type) {
case RPM_INT32_TYPE:
- sprintf(numbuf, "%d", *body.i32p);
+ rasprintf(&numbuf, "%d", *body.i32p);
addMacro(NULL, tagm->macroname, NULL, numbuf, -1);
+ numbuf = _free(numbuf);
break;
case RPM_STRING_TYPE:
addMacro(NULL, tagm->macroname, NULL, body.str, -1);
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 9066743c0..290359b23 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -312,9 +312,7 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p
mi = rpmdbFreeIterator(mi);
if (ix >= 0) {
- char hnum[32];
- sprintf(hnum, "h#%d", hx);
- pubkeysource = xstrdup(hnum);
+ rasprintf(&pubkeysource, "h#%d", hx);
} else {
ts->pkpkt = _free(ts->pkpkt);
ts->pkpktlen = 0;