change length or size specifiers in APIs from int to long
add array API (http://cr.yp.to/lib/array.html)
This commit is contained in:
16
array/array_catb.c
Normal file
16
array/array_catb.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "array.h"
|
||||
#include "byte.h"
|
||||
|
||||
void array_catb(array* to,const char* from,uint64 len) {
|
||||
long l;
|
||||
if (to->allocated<0) return;
|
||||
if (to->initialized+len<to->initialized) {
|
||||
fail:
|
||||
array_fail(to);
|
||||
return;
|
||||
}
|
||||
l=to->initialized;
|
||||
if (!array_allocate(to,1,to->initialized+len))
|
||||
goto fail;
|
||||
byte_copy(to->p+l,to->initialized-l,from);
|
||||
}
|
||||
Reference in New Issue
Block a user