249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
if ((obj = va_arg(ctx->args, id)) != nil)
tmp_len = asprintf(&tmp, ctx->subfmt,
[[obj description] cString]);
else
if (!append_str(ctx, "(nil)", 5))
return false;
} @catch (id e) {
[e release];
return false;
} @finally {
[pool release];
}
break;
case 'd':
case 'i':
|
|
|
|
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
if ((obj = va_arg(ctx->args, id)) != nil)
tmp_len = asprintf(&tmp, ctx->subfmt,
[[obj description] cString]);
else
if (!append_str(ctx, "(nil)", 5))
return false;
} @catch (id e) {
free(ctx->buf);
@throw e;
} @finally {
[pool release];
}
break;
case 'd':
case 'i':
|
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
|
ctx.len_mod = LENGTH_MODIFIER_NONE;
if ((ctx.buf = malloc(1)) == NULL)
return -1;
for (ctx.i = 0; ctx.i < ctx.fmt_len; ctx.i++) {
if (!states[ctx.state](&ctx)) {
if (ctx.buf != NULL)
free(ctx.buf);
return -1;
}
}
if (ctx.state != STATE_STRING) {
if (ctx.buf != NULL)
free(ctx.buf);
return -1;
}
if (!append_str(&ctx, ctx.fmt + ctx.last, ctx.fmt_len - ctx.last)) {
free(ctx.buf);
return -1;
}
|
<
|
<
<
|
<
|
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
|
ctx.len_mod = LENGTH_MODIFIER_NONE;
if ((ctx.buf = malloc(1)) == NULL)
return -1;
for (ctx.i = 0; ctx.i < ctx.fmt_len; ctx.i++) {
if (!states[ctx.state](&ctx)) {
free(ctx.buf);
return -1;
}
}
if (ctx.state != STATE_STRING) {
free(ctx.buf);
return -1;
}
if (!append_str(&ctx, ctx.fmt + ctx.last, ctx.fmt_len - ctx.last)) {
free(ctx.buf);
return -1;
}
|