| 3053 | /* Restrict to the final answer line: digits after it (continued |
| 3054 | * reasoning, footnotes, years) must not override the answer. */ |
| 3055 | const char *nl = memchr(answer, '\n', (size_t)(end - answer)); |
| 3056 | if (nl) end = nl; |
| 3057 | /* When the line shows arithmetic ("m+n = 256+37 = 293") the stated |
| 3058 | * result is the right-hand side of the LAST '='. Otherwise the first |
| 3059 | * integer on the line is the answer (keeps "Final answer: 082"). */ |
| 3060 | const char *eq = NULL; |
| 3061 | for (const char *r = answer; r < end; r++) if (*r == '=') eq = r; |
| 3062 | if (scan_first_integer(eq ? eq + 1 : answer, end, dst, dstlen)) return; |
| 3063 | if (eq && scan_first_integer(answer, end, dst, dstlen)) return; |
| 3064 | } |
| 3065 |
no outgoing calls
no test coverage detected