| 2406 | } |
| 2407 | |
| 2408 | static unsigned long sane_truncate_line(char *line, unsigned long len) |
| 2409 | { |
| 2410 | const char *cp; |
| 2411 | unsigned long allot; |
| 2412 | size_t l = len; |
| 2413 | |
| 2414 | cp = line; |
| 2415 | allot = l; |
| 2416 | while (0 < l) { |
| 2417 | (void) utf8_width(&cp, &l); |
| 2418 | if (!cp) |
| 2419 | break; /* truncated in the middle? */ |
| 2420 | } |
| 2421 | return allot - l; |
| 2422 | } |
| 2423 | |
| 2424 | static void find_lno(const char *line, struct emit_callback *ecbdata) |
| 2425 | { |
no test coverage detected