aboutsummaryrefslogtreecommitdiff
path: root/src/triplet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/triplet.c')
-rw-r--r--src/triplet.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/triplet.c b/src/triplet.c
index 6bd9e6a..9f051db 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -352,3 +352,4 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
struct tm *tm;
- char *buf;
+ char *buf = NULL;
+ size_t size = 0;
@@ -387,6 +388,8 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
- asprintf (&buf,
- "%s %s %s %*s %s %s",
- modes, user_name, group_name, ugswidth - pad + slen, sptr,
- timebuf, info->name);
+ if (grecs_asprintf (&buf, &size,
+ "%s %s %s %*s %s %s",
+ modes, user_name, group_name, ugswidth - pad + slen,
+ sptr,
+ timebuf, info->name))
+ xalloc_die ();
*pret = buf;
@@ -547,4 +550,6 @@ expand_email_user (struct metadef *def, void *data)
{
- 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;
@@ -593,3 +598,6 @@ expand_check_result (struct metadef *def, void *data)
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 ();
}

Return to:

Send suggestions and report system problems to the System administrator.