summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJindrich Novy <jnovy@redhat.com>2008-04-20 12:17:37 +0200
committerJindrich Novy <jnovy@redhat.com>2008-04-20 21:49:51 +0200
commit3dad7b6f0f463d23518f01543da9b958c6fc12f0 (patch)
tree834df40718d2b81d7b93a3354c10e17b3e55ad10 /lib
parentcee73cdc0b165a4044795accde68bf37a7684125 (diff)
downloadrpm-3dad7b6f0f463d23518f01543da9b958c6fc12f0.tar.gz
rpm-3dad7b6f0f463d23518f01543da9b958c6fc12f0.tar.bz2
rpm-3dad7b6f0f463d23518f01543da9b958c6fc12f0.zip
Don't use static buffers
Diffstat (limited to 'lib')
-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;