Hi,
I'm not familiar with sed implementation, but 'copy_to_genbuf' looks spurious.
Actually it only expands a buffer if some space is needed, but nothing is copied.
Should it look like:
static void copy_to_genbuf(sed_eval_t *eval, const char* sz)
{
int len = strlen(sz);
unsigned int reqsize = len + 1;
if (eval->gsize < reqsize) {
grow_gen_buffer(eval, reqsize, NULL);
}
memcpy(eval->gspend, sz, len + 1);
/* hspend will now point to NULL character */
eval->gspend += len;
}
?
