Coverage Report

Created: 2026-05-19 06:33

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/nspr/lib/libc/src/strpbrk.c
Line
Count
Source
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#include "plstr.h"
6
#include <string.h>
7
8
PR_IMPLEMENT(char*)
9
0
PL_strpbrk(const char* s, const char* list) {
10
0
  if (((const char*)0 == s) || ((const char*)0 == list)) {
11
0
    return (char*)0;
12
0
  }
13
14
0
  return strpbrk(s, list);
15
0
}
16
17
PR_IMPLEMENT(char*)
18
0
PL_strprbrk(const char* s, const char* list) {
19
0
  const char* p;
20
0
  const char* r;
21
22
0
  if (((const char*)0 == s) || ((const char*)0 == list)) {
23
0
    return (char*)0;
24
0
  }
25
26
0
  for (r = s; *r; r++);
27
28
0
  for (r--; r >= s; r--)
29
0
    for (p = list; *p; p++)
30
0
      if (*r == *p) {
31
0
        return (char*)r;
32
0
      }
33
34
0
  return (char*)0;
35
0
}
36
37
PR_IMPLEMENT(char*)
38
0
PL_strnpbrk(const char* s, const char* list, PRUint32 max) {
39
0
  const char* p;
40
41
0
  if (((const char*)0 == s) || ((const char*)0 == list)) {
42
0
    return (char*)0;
43
0
  }
44
45
0
  for (; max && *s; s++, max--)
46
0
    for (p = list; *p; p++)
47
0
      if (*s == *p) {
48
0
        return (char*)s;
49
0
      }
50
51
0
  return (char*)0;
52
0
}
53
54
PR_IMPLEMENT(char*)
55
0
PL_strnprbrk(const char* s, const char* list, PRUint32 max) {
56
0
  const char* p;
57
0
  const char* r;
58
59
0
  if (((const char*)0 == s) || ((const char*)0 == list)) {
60
0
    return (char*)0;
61
0
  }
62
63
0
  for (r = s; max && *r; r++, max--);
64
65
0
  for (r--; r >= s; r--)
66
0
    for (p = list; *p; p++)
67
0
      if (*r == *p) {
68
0
        return (char*)r;
69
0
      }
70
71
0
  return (char*)0;
72
0
}