2003-08-26 17:58:14 +00:00
|
|
|
#include "array.h"
|
|
|
|
#include "byte.h"
|
|
|
|
|
|
|
|
void array_catb(array* to,const char* from,uint64 len) {
|
|
|
|
long l;
|
2003-12-05 17:30:03 +00:00
|
|
|
if (!len) return;
|
2003-08-26 17:58:14 +00:00
|
|
|
if (to->allocated<0) return;
|
|
|
|
if (to->initialized+len<to->initialized) {
|
|
|
|
fail:
|
|
|
|
array_fail(to);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
l=to->initialized;
|
2003-09-10 01:59:12 +00:00
|
|
|
if (!array_allocate(to,1,to->initialized+len-1))
|
2003-08-26 17:58:14 +00:00
|
|
|
goto fail;
|
|
|
|
byte_copy(to->p+l,to->initialized-l,from);
|
|
|
|
}
|