The first min(n, cap) bytes as a C string in dst[cap + 1]. The probes are * string scans, so an embedded NUL ends what they see, as it always did. */
| 1177 | /* The first min(n, cap) bytes as a C string in dst[cap + 1]. The probes are |
| 1178 | * string scans, so an embedded NUL ends what they see, as it always did. */ |
| 1179 | static void lang_head_text(char *dst, size_t cap, const unsigned char *head, size_t n) { |
| 1180 | size_t len = n < cap ? n : cap; |
| 1181 | if (len > 0) { |
| 1182 | memcpy(dst, head, len); |
| 1183 | } |
| 1184 | dst[len] = '\0'; |
| 1185 | } |
| 1186 | |
| 1187 | /* The first `cap` bytes of a file, raw. false when the file cannot be opened. |
| 1188 | * A read error keeps the bytes read before it, as the probes always did. */ |
no outgoing calls
no test coverage detected