The first quoted literal in `text` ("..", '..' or `..`), copied without * its quotes. False when there is none. */
| 502 | /* The first quoted literal in `text` ("..", '..' or `..`), copied without |
| 503 | * its quotes. False when there is none. */ |
| 504 | static bool spawn_first_literal(const char *text, char *out, size_t n) { |
| 505 | for (const char *p = text; *p; p++) { |
| 506 | if (*p != '"' && *p != '\'' && *p != '`') { |
| 507 | continue; |
| 508 | } |
| 509 | const char *end = p + 1; |
| 510 | while (*end && *end != *p) { |
| 511 | end += (*end == '\\' && end[1]) ? 2 : 1; |
| 512 | } |
| 513 | if (!*end) { |
| 514 | return false; |
| 515 | } |
| 516 | size_t len = (size_t)(end - p - 1); |
| 517 | if (len >= n) { |
| 518 | len = n - 1; |
| 519 | } |
| 520 | memcpy(out, p + 1, len); |
| 521 | out[len] = '\0'; |
| 522 | return true; |
| 523 | } |
| 524 | return false; |
| 525 | } |
| 526 | |
| 527 | static const char *spawn_arg_expr(const CBMCall *call, int index) { |
| 528 | for (int i = 0; i < call->arg_count; i++) { |
no outgoing calls
no test coverage detected