* sl_add(): Add an item to the string list */
| 68 | * sl_add(): Add an item to the string list |
| 69 | */ |
| 70 | int |
| 71 | sl_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 | /* |
nothing calls this directly
no test coverage detected