diff options
Diffstat (limited to 'src/utils.c')
| -rw-r--r-- | src/utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c index 5296332..9fa4d80 100644 --- a/src/utils.c +++ b/src/utils.c | |||
| @@ -124,6 +124,14 @@ int collection_count(struct collection *col) | |||
| 124 | return cnt; | 124 | return cnt; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | void collection_copy(struct collection *dest, struct collection *src) | ||
| 128 | { | ||
| 129 | if (!dest || !src) return; | ||
| 130 | dest->capacity = src->capacity; | ||
| 131 | dest->list = malloc(sizeof(void*) * src->capacity); | ||
| 132 | memcpy(dest->list, src->list, sizeof(void*) * src->capacity); | ||
| 133 | } | ||
| 134 | |||
| 127 | #ifndef HAVE_STPCPY | 135 | #ifndef HAVE_STPCPY |
| 128 | /** | 136 | /** |
| 129 | * Copy characters from one string into another | 137 | * Copy characters from one string into another |
