mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-22 15:16:36 -08:00
Fix several small issues
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "vector.h"
|
||||
|
||||
@@ -49,3 +50,12 @@ void vec_deep_destroy(struct vector *v) {
|
||||
}
|
||||
vec_destroy(v);
|
||||
}
|
||||
|
||||
struct vector *vec_dup(struct vector *v) {
|
||||
struct vector *ret = malloc(sizeof(*ret));
|
||||
vec_size(ret) = vec_size(v);
|
||||
vec_cap(ret) = vec_cap(v);
|
||||
vec_entry(v) = malloc(sizeof(void*) * vec_cap(ret));
|
||||
memcpy(vec_entry(ret), vec_entry(v), sizeof(void*) * vec_cap(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user