LCOV - code coverage report
Current view: top level - ccan/str - str.c (source / functions) Coverage Total Hit
Test: skiboot.info Lines: 100.0 % 6 6
Test Date: 2025-01-24 18:40:10 Functions: 100.0 % 1 1
Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : /* CC0 (Public domain) - see LICENSE file for details */
       2                 :             : #include <ccan/str/str.h>
       3                 :             : 
       4                 :         149 : size_t strcount(const char *haystack, const char *needle)
       5                 :             : {
       6                 :         149 :         size_t i = 0, nlen = strlen(needle);
       7                 :             : 
       8                 :         236 :         while ((haystack = strstr(haystack, needle)) != NULL) {
       9                 :          87 :                 i++;
      10                 :          87 :                 haystack += nlen;
      11                 :             :         }
      12                 :         149 :         return i;
      13                 :             : }
        

Generated by: LCOV version 2.0-1