MCPcopy Create free account
hub / github.com/coreboot/coreboot / strconcat

Function strconcat

src/lib/string.c:21–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21char *strconcat(const char *s1, const char *s2)
22{
23 if (!ENV_RAMSTAGE)
24 dead_code(); /* This can't be used without malloc(). */
25
26 size_t sz_1 = strlen(s1);
27 size_t sz_2 = strlen(s2);
28 char *d = malloc(sz_1 + sz_2 + 1);
29 if (d) {
30 memcpy(d, s1, sz_1);
31 memcpy(d + sz_1, s2, sz_2 + 1);
32 }
33 return d;
34}
35
36char *strchr(const char *s, int c)
37{

Callers 2

dl_oem_smbios_stringsFunction · 0.85
test_strconcatFunction · 0.85

Calls 3

strlenFunction · 0.85
mallocFunction · 0.70
memcpyFunction · 0.70

Tested by 1

test_strconcatFunction · 0.68