Coverage Report

Created: 2026-06-07 07:11

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/nspr/lib/libc/src/strcat.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_strcat(char* dest, const char* src) {
10
0
  if (((char*)0 == dest) || ((const char*)0 == src)) {
11
0
    return dest;
12
0
  }
13
14
0
  return strcat(dest, src);
15
0
}
16
17
PR_IMPLEMENT(char*)
18
0
PL_strncat(char* dest, const char* src, PRUint32 max) {
19
0
  char* rv;
20
21
0
  if (((char*)0 == dest) || ((const char*)0 == src) || (0 == max)) {
22
0
    return dest;
23
0
  }
24
25
0
  for (rv = dest; *dest; dest++);
26
27
0
  (void)PL_strncpy(dest, src, max);
28
0
  return rv;
29
0
}
30
31
PR_IMPLEMENT(char*)
32
0
PL_strcatn(char* dest, PRUint32 max, const char* src) {
33
0
  char* rv;
34
0
  PRUint32 dl;
35
36
0
  if (((char*)0 == dest) || ((const char*)0 == src)) {
37
0
    return dest;
38
0
  }
39
40
0
  for (rv = dest, dl = 0; *dest; dest++, dl++);
41
42
0
  if (max <= dl) {
43
0
    return rv;
44
0
  }
45
0
  (void)PL_strncpyz(dest, src, max - dl);
46
47
0
  return rv;
48
0
}