catch error from as.*printf

This commit is contained in:
Love Hornquist Astrand
2010-05-30 13:44:41 -07:00
parent 077357c848
commit 2b1645aa08
9 changed files with 50 additions and 39 deletions

View File

@@ -129,8 +129,9 @@ main(int argc, char **argv)
* test import/export
*/
str = NULL;
len = asprintf(&str, "ftp@freeze-arrow.mit.edu");
if (len == -1)
if (len < 0 || str == NULL)
errx(1, "asprintf");
name_buffer.value = str;
@@ -183,8 +184,9 @@ main(int argc, char **argv)
* Dovecot SASL lib does this.
*/
str = NULL;
len = asprintf(&str, "lha");
if (len == -1)
if (len < 0 || str == NULL)
errx(1, "asprintf");
name_buffer.value = str;