MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / String_CopyToRaw

Function String_CopyToRaw

src/String.c:41–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41int String_CopyToRaw(char* dst, int capacity, const cc_string* src) {
42 int i, len = min(capacity, src->length);
43 for (i = 0; i < len; i++) { dst[i] = src->buffer[i]; }
44
45 /* add \0 to mark end of used portion of buffer */
46 if (len < capacity) dst[len] = '\0';
47 return len;
48}
49
50cc_string String_UNSAFE_Substring(STRING_REF const cc_string* str, int offset, int length) {
51 if (offset < 0 || offset > str->length) {

Callers 7

Window_SetTitleFunction · 0.85
SysFont_MakeFunction · 0.85
Block_SetNameFunction · 0.85
Platform_EncodePathFunction · 0.85
Platform_EncodePathFunction · 0.85
Platform_EncodePathFunction · 0.85
Platform_EncodePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected