MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / String_duplicate

Function String_duplicate

Tools/ToolsBootstrap.c:505–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503
504void StringVector_add(StringVector* sv, const char* str) {
505 if (sv->count >= sv->capacity) {
506 size_t new_capacity = sv->capacity * 2;
507 if (new_capacity == 0) new_capacity = 8;
508 char** new_data = (char**)realloc(sv->data, sizeof(char*) * new_capacity);
509 if (!new_data) return;
510 sv->data = new_data;
511 sv->capacity = new_capacity;
512 }
513 sv->data[sv->count] = (char*)malloc(strlen(str) + 1);

Callers 4

deriveToolIdentityFunction · 0.85
parseArgsFunction · 0.85
setupCompilationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected