diff options
author | cathook <cat.hook31894@gmail.com> | 2013-11-26 00:49:39 +0800 |
---|---|---|
committer | cathook <cat.hook31894@gmail.com> | 2013-11-26 00:49:39 +0800 |
commit | 0e595fc7ef0a8e6deafebab7ac4437a471f52686 (patch) | |
tree | f6b0cdb9a14ab17c9763865857da7b4209bb9d56 | |
parent | 32939724ab1158ed616f800086eefa32d3a93a3f (diff) | |
parent | bfd132727bdb65844c0349a616b9d926a2b16b22 (diff) | |
download | ctl-0e595fc7ef0a8e6deafebab7ac4437a471f52686.tar.gz ctl-0e595fc7ef0a8e6deafebab7ac4437a471f52686.tar.zst ctl-0e595fc7ef0a8e6deafebab7ac4437a471f52686.zip |
Merge branch 'feature-vector'
-rw-r--r-- | src/vector.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vector.c b/src/vector.c index 4f8446c..317ddf1 100644 --- a/src/vector.c +++ b/src/vector.c @@ -115,16 +115,16 @@ int ctl_vector_catX(ppvoid v, ppcvoid v2){ return count0 + count2; } pvoid ctl_vector_copyX(ppvoid v, ppcvoid v2){ - VectorHeader *tmp = getHeader(*v2); - pvoid p = malloc(getTotal(tmp)); - memcpy(p, pVoid(tmp), getTotal(tmp)); + VectorHeader* tmp = getHeader(*v2); + VectorHeader* p = (VectorHeader*)malloc(getTotal(tmp)); + memcpy(pVoid(p), pVoid(tmp), getTotal(tmp)); if(v != NULL){ if(*v != NULL){ ctl_vector_free(v); } - *v = p; + *v = p->buf; } - return p; + return p->buf; } int ctl_vector_replaceX( ppvoid v , uint start1, uint length1, ppcvoid v2, uint start2, int length2){ |