static_inline bool is_truncated_str()

in include/yyjson/yyjson.c [3978:3992]


static_inline bool is_truncated_str(u8 *cur, u8 *end,
                                    const char *str,
                                    bool case_sensitive) {
    usize len = strlen(str);
    if (cur + len <= end || end <= cur) return false;
    if (case_sensitive) {
        return memcmp(cur, str, (usize)(end - cur)) == 0;
    }
    for (; cur < end; cur++, str++) {
        if ((*cur != (u8)*str) && (*cur != (u8)*str - 'a' + 'A')) {
            return false;
        }
    }
    return true;
}