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
@@ -350,7 +350,8 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
350 char *user_name; 350 char *user_name;
351 char *group_name; 351 char *group_name;
352 struct tm *tm; 352 struct tm *tm;
353 char *buf; 353 char *buf = NULL;
354 size_t size = 0;
354 355
355 if (!info->name) 356 if (!info->name)
356 return 1; 357 return 1;
@@ -385,10 +386,12 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
385 if (pad > ugswidth) 386 if (pad > ugswidth)
386 ugswidth = pad; 387 ugswidth = pad;
387 388
388 asprintf (&buf, 389 if (grecs_asprintf (&buf, &size,
389 "%s %s %s %*s %s %s", 390 "%s %s %s %*s %s %s",
390 modes, user_name, group_name, ugswidth - pad + slen, sptr, 391 modes, user_name, group_name, ugswidth - pad + slen,
391 timebuf, info->name); 392 sptr,
393 timebuf, info->name))
394 xalloc_die ();
392 *pret = buf; 395 *pret = buf;
393 return 0; 396 return 0;
394} 397}
@@ -545,8 +548,10 @@ expand_email_user (struct metadef *def, void *data)
545 struct file_triplet *trp = data; 548 struct file_triplet *trp = data;
546 if (trp->uploader) 549 if (trp->uploader)
547 { 550 {
548 asprintf (&def->storage, "\"%s\" <%s>", 551 size_t size = 0;
549 trp->uploader->realname, trp->uploader->email); 552 if (grecs_asprintf (&def->storage, &size, "\"%s\" <%s>",
553 trp->uploader->realname, trp->uploader->email))
554 xalloc_die ();
550 def->value = def->storage; 555 def->value = def->storage;
551 } 556 }
552 return def->value; 557 return def->value;
@@ -591,7 +596,10 @@ expand_check_result (struct metadef *def, void *data)
591 else if (WIFSIGNALED (status)) 596 else if (WIFSIGNALED (status))
592 { 597 {
593 char *p = umaxtostr (WTERMSIG (status), sbuf); 598 char *p = umaxtostr (WTERMSIG (status), sbuf);
594 asprintf (&def->storage, "SIG+%s", p); 599 size_t size = 0;
600 def->storage = NULL;
601 if (grecs_asprintf (&def->storage, &size, "SIG+%s", p))
602 xalloc_die ();
595 } 603 }
596 else 604 else
597 def->storage = "[unrecognized return code]"; 605 def->storage = "[unrecognized return code]";

Return to:

Send suggestions and report system problems to the System administrator.