MCPcopy Create free account
hub / github.com/Kitware/CMake / kwsysSystem__AppendByte

Function kwsysSystem__AppendByte

Source/kwsys/System.c:26–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#endif
25
26static int kwsysSystem__AppendByte(char const* local, char** begin, char** end,
27 int* size, char c)
28{
29 /* Allocate space for the character. */
30 if ((*end - *begin) >= *size) {
31 kwsysSystem_ptrdiff_t length = *end - *begin;
32 char* newBuffer = (char*)malloc((size_t)(*size * 2));
33 if (!newBuffer) {
34 return 0;
35 }
36 memcpy(newBuffer, *begin, (size_t)(length) * sizeof(char));
37 if (*begin != local) {
38 free(*begin);
39 }
40 *begin = newBuffer;
41 *end = *begin + length;
42 *size *= 2;
43 }
44
45 /* Store the character. */
46 *(*end)++ = c;
47 return 1;
48}
49
50static int kwsysSystem__AppendArgument(char** local, char*** begin,
51 char*** end, int* size, char* arg_local,

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…