MCPcopy Index your code
hub / github.com/F-Stack/f-stack / sl_add

Function sl_add

tools/compat/stringlist.c:70–81  ·  view source on GitHub ↗

* sl_add(): Add an item to the string list */

Source from the content-addressed store, hash-verified

68 * sl_add(): Add an item to the string list
69 */
70int
71sl_add(StringList *sl, char *name)
72{
73 if (sl->sl_cur == sl->sl_max - 1) {
74 sl->sl_max += _SL_CHUNKSIZE;
75 sl->sl_str = reallocf(sl->sl_str, sl->sl_max * sizeof(char *));
76 if (sl->sl_str == NULL)
77 return (-1);
78 }
79 sl->sl_str[sl->sl_cur++] = name;
80 return (0);
81}
82
83
84/*

Callers

nothing calls this directly

Calls 1

reallocfFunction · 0.70

Tested by

no test coverage detected