Alvaro Herrera <[EMAIL PROTECTED]> 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
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
