aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/triplet.c23
-rw-r--r--src/wydawca.c7
2 files changed, 18 insertions, 12 deletions
diff --git a/src/triplet.c b/src/triplet.c
index 9f051db..bfd58e5 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -345,5 +345,4 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
struct group *grp;
- char sbuf[INT_BUFSIZE_BOUND (uintmax_t)];
- char *sptr;
- size_t slen;
+ char *sptr = NULL;
+ size_t slen = 0;
int pad;
@@ -380,3 +379,4 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
/* Size */
- sptr = umaxtostr (info->sb.st_size, sbuf);
+ if (grecs_asprintf (&sptr, &slen, "%lu", (unsigned long) info->sb.st_size))
+ xalloc_die ();
@@ -394,2 +394,3 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
xalloc_die ();
+ free (sptr);
*pret = buf;
@@ -586,3 +587,2 @@ expand_check_result (struct metadef *def, void *data)
int status = trp->check_result;
- char sbuf[INT_BUFSIZE_BOUND (uintmax_t)];
@@ -592,4 +592,7 @@ expand_check_result (struct metadef *def, void *data)
{
- char *p = umaxtostr (WEXITSTATUS (status), sbuf);
- def->storage = xstrdup (p);
+ size_t size = 0;
+ def->storage = NULL;
+ if (grecs_asprintf (&def->storage, &size,
+ "%d", WEXITSTATUS (status)))
+ xalloc_die ();
}
@@ -597,6 +600,6 @@ expand_check_result (struct metadef *def, void *data)
{
- char *p = umaxtostr (WTERMSIG (status), sbuf);
size_t size = 0;
def->storage = NULL;
- if (grecs_asprintf (&def->storage, &size, "SIG+%s", p))
+ if (grecs_asprintf (&def->storage, &size, "SIG+%d",
+ WTERMSIG (status)))
xalloc_die ();
@@ -604,3 +607,3 @@ expand_check_result (struct metadef *def, void *data)
else
- def->storage = "[unrecognized return code]";
+ return def->value = "[unrecognized return code]";
return def->value = def->storage;
diff --git a/src/wydawca.c b/src/wydawca.c
index 12649d3..171b97b 100644
--- a/src/wydawca.c
+++ b/src/wydawca.c
@@ -177,4 +177,7 @@ stat_expand (struct metadef *def, void *data)
{
- char sbuf[INT_BUFSIZE_BOUND (wydawca_stat[0])];
- def->storage = xstrdup (uinttostr (wydawca_stat[(int) def->data], sbuf));
+ size_t size = 0;
+ def->storage = NULL;
+ if (grecs_asprintf (&def->storage, &size, "%u",
+ wydawca_stat[(int) def->data]))
+ xalloc_die ();
def->value = def->storage;

Return to:

Send suggestions and report system problems to the System administrator.