summaryrefslogtreecommitdiffabout
path: root/src/triplet.c
Side-by-side diff
Diffstat (limited to 'src/triplet.c') (more/less context) (show whitespace changes)
-rw-r--r--src/triplet.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/triplet.c b/src/triplet.c
index 6bd9e6a..9f051db 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -350,7 +350,8 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
char *user_name;
char *group_name;
struct tm *tm;
- char *buf;
+ char *buf = NULL;
+ size_t size = 0;
if (!info->name)
return 1;
@@ -385,10 +386,12 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
if (pad > ugswidth)
ugswidth = pad;
- asprintf (&buf,
+ if (grecs_asprintf (&buf, &size,
"%s %s %s %*s %s %s",
- modes, user_name, group_name, ugswidth - pad + slen, sptr,
- timebuf, info->name);
+ modes, user_name, group_name, ugswidth - pad + slen,
+ sptr,
+ timebuf, info->name))
+ xalloc_die ();
*pret = buf;
return 0;
}
@@ -545,8 +548,10 @@ expand_email_user (struct metadef *def, void *data)
struct file_triplet *trp = data;
if (trp->uploader)
{
- asprintf (&def->storage, "\"%s\" <%s>",
- trp->uploader->realname, trp->uploader->email);
+ size_t size = 0;
+ if (grecs_asprintf (&def->storage, &size, "\"%s\" <%s>",
+ trp->uploader->realname, trp->uploader->email))
+ xalloc_die ();
def->value = def->storage;
}
return def->value;
@@ -591,7 +596,10 @@ expand_check_result (struct metadef *def, void *data)
else if (WIFSIGNALED (status))
{
char *p = umaxtostr (WTERMSIG (status), sbuf);
- asprintf (&def->storage, "SIG+%s", p);
+ size_t size = 0;
+ def->storage = NULL;
+ if (grecs_asprintf (&def->storage, &size, "SIG+%s", p))
+ xalloc_die ();
}
else
def->storage = "[unrecognized return code]";

Return to:

Send suggestions and report system problems to the System administrator.