| 526 | } |
| 527 | |
| 528 | static int |
| 529 | xo_depth_check (xo_handle_t *xop, int depth) |
| 530 | { |
| 531 | xo_stack_t *xsp; |
| 532 | |
| 533 | if (depth >= xop->xo_stack_size) { |
| 534 | depth += XO_DEPTH; /* Extra room */ |
| 535 | |
| 536 | xsp = xo_realloc(xop->xo_stack, sizeof(xop->xo_stack[0]) * depth); |
| 537 | if (xsp == NULL) { |
| 538 | xo_failure(xop, "xo_depth_check: out of memory (%d)", depth); |
| 539 | return -1; |
| 540 | } |
| 541 | |
| 542 | int count = depth - xop->xo_stack_size; |
| 543 | |
| 544 | bzero(xsp + xop->xo_stack_size, count * sizeof(*xsp)); |
| 545 | xop->xo_stack_size = depth; |
| 546 | xop->xo_stack = xsp; |
| 547 | } |
| 548 | |
| 549 | return 0; |
| 550 | } |
| 551 | |
| 552 | void |
| 553 | xo_no_setlocale (void) |
no test coverage detected