Differences From Artifact [45f853ae7d]:
- File
src/of_asprintf.m
— part of check-in
[2a27cf3000]
at
2016-01-03 00:41:26
on branch trunk
— Update copyright
While at it, also update the mail address. (user: js, size: 14338) [annotate] [blame] [check-ins using]
To Artifact [bff5bd9808]:
- File src/of_asprintf.m — part of check-in [e0b9167693] at 2016-02-21 15:37:42 on branch trunk — Make use of C99-style for loops (user: js, size: 14348) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
377 378 379 380 381 382 383 | return false; ctx->subformat[ctx->subformatLen - 1] = 's'; { const of_unichar_t *arg = va_arg(ctx->arguments, const of_unichar_t*); | | > | | 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | return false; ctx->subformat[ctx->subformatLen - 1] = 's'; { const of_unichar_t *arg = va_arg(ctx->arguments, const of_unichar_t*); size_t j, len = of_string_utf32_length(arg); char *buffer; if (SIZE_MAX / 4 < len || (SIZE_MAX / 4) - len < 1) return false; if ((buffer = malloc((len * 4) + 1)) == NULL) return false; j = 0; for (size_t i = 0; i < len; i++) { size_t clen = of_string_utf8_encode(arg[i], buffer + j); if (clen == 0) { free(buffer); return false; } |
︙ | ︙ |