Fix CID 1135173

This commit is contained in:
jvoisin 2014-05-01 00:29:35 +02:00
parent ee6a4cd5bd
commit b55f80cd50

View File

@ -80,16 +80,12 @@ memChunk *memString(char *string){
void memCopy(memChunk *dest,memChunk *source){
long nbytes;
memCheckState();
if(!source->address) return;
if(!dest->address){
dest=memString(source->address);
}else{
nbytes=dest->size > source->size ? source->size : dest->size;
#if DEBUG3
printf("Copying %d bytes to dest (size %d)\n",nbytes,dest->address,dest->size);
#endif
memcpy(dest->address,source->address,nbytes);
}
if ((!source->address) || (!dest->address)) return;
nbytes=dest->size > source->size ? source->size : dest->size;
#if DEBUG3
printf("Copying %d bytes to dest (size %d)\n",nbytes,dest->address,dest->size);
#endif
memcpy(dest->address,source->address,nbytes);
}
void memStrCat(memChunk *dest,char *string){