Mercurial > hg > th-libs
comparison th_string.c @ 260:ab18ebbb5529
Check for NULL fmt.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 17 Feb 2016 12:59:51 +0200 |
parents | 855f8dc6f123 |
children | e459a28ee1be |
comparison
equal
deleted
inserted
replaced
259:33652234f162 | 260:ab18ebbb5529 |
---|---|
450 */ | 450 */ |
451 char *th_strdup_vprintf(const char *fmt, va_list args) | 451 char *th_strdup_vprintf(const char *fmt, va_list args) |
452 { | 452 { |
453 int size = 64; | 453 int size = 64; |
454 char *buf, *tmp; | 454 char *buf, *tmp; |
455 | |
456 if (fmt == NULL) | |
457 return NULL; | |
455 | 458 |
456 if ((buf = th_malloc(size)) == NULL) | 459 if ((buf = th_malloc(size)) == NULL) |
457 return NULL; | 460 return NULL; |
458 | 461 |
459 while (1) | 462 while (1) |