The first HL_PATH_CAP - 1 bytes of " / ": the name the old * unchecked 1 KiB buffer cut that path down to. */
| 16116 | /* The first HL_PATH_CAP - 1 bytes of "<base>/<suffix>": the name the old |
| 16117 | * unchecked 1 KiB buffer cut that path down to. */ |
| 16118 | static void hl_cut_name(char *out, const char *base, const char *suffix) { |
| 16119 | char full[2 * HL_PATH_CAP]; |
| 16120 | snprintf(full, sizeof(full), "%s/%s", base, suffix); |
| 16121 | snprintf(out, HL_PATH_CAP, "%.*s", HL_PATH_CAP - 1, full); |
| 16122 | } |
| 16123 | |
| 16124 | static bool hl_is_ancestor_or_self(const char *path, const char *of) { |
| 16125 | size_t n = strlen(path); |