Alvaro Herrera <alvherre(at)atentus(dot)com> writes:
> ! ret=(char *)malloc(sizeof(char)*strlen(t));
> ! strncpy(ret, t, strlen(t));
>
> ! ret=(char *)malloc(sizeof(char)*(strlen(t)+1));
> ! strncpy(ret, t, strlen(t)+1);
What have you got against strdup() ?
regards, tom lane