/* SPDX-License-Identifier: GPL-3.0-or-later */ /* Copyright 2022 Ivan Polyakov */ #include "utils.h" int count_char_entries(const char *str, char ch) { int cnt = 0; while (*str) { if (*str == ch) { cnt++; } str++; } return cnt; }