comparison sidinfo.c @ 320:e315bed7d791

Minor cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 11 Jan 2020 20:18:24 +0200
parents 6d0143e43edf
children 3bb2e0bdd1f0
comparison
equal deleted inserted replaced
319:6d0143e43edf 320:e315bed7d791
469 char * siItemFormatStrPrint(const char *fmt, const int otype, const char *d_str, const int d_int) 469 char * siItemFormatStrPrint(const char *fmt, const int otype, const char *d_str, const int d_int)
470 { 470 {
471 th_vprintf_ctx ctx; 471 th_vprintf_ctx ctx;
472 472
473 ctx.size = 128; 473 ctx.size = 128;
474 ctx.buf = th_malloc(ctx.size); 474 ctx.pos = 0;
475 ctx.pos = 0;
476 ctx.ipos = 0; 475 ctx.ipos = 0;
477 476
478 if (ctx.buf == NULL) 477 if ((ctx.buf = th_malloc(ctx.size)) == NULL)
479 return NULL; 478 return NULL;
480 479
481 if (siItemFormatStrPrintDo(&ctx, siItemFormatStrPutCH, fmt, otype, d_str, d_int) <= 0) 480 if (siItemFormatStrPrintDo(&ctx, siItemFormatStrPutCH, fmt, otype, d_str, d_int) <= 0)
482 goto err; 481 goto err;
483 482