Can someone tell me what I'm doing wrong?
okuyamak at dd.iij4u.or.jp
Wed May 23 04:31:53 GMT 2001
>>>>> "RVD" == Ray Van Dolson <rayvd at bludgeon.org> writes:
RVD> Well... I changed this just in case, although it had worked previously
RVD> with this same bit of code... anyways, changed the strncpy line to account
RVD> for \0 and it still segfaults. sigh... any other suggestions? :)
Because you said so, I believe
are all fixed correctly.
Here comes the next:
2) I don't think this will cause segfault, but just in case...
RVD> char temp;
RVD> if (temp[strlen(temp) - 1] == 0x0a) /* A new line? */
RVD> temp[strlen(temp) - 1] = 0x00;
I don't understand what you're doing here.
temp is only declared, but not being initialized.
so, if you run 'strlen(temp)' you have possibility of segfault.
you have three of them looking alike.
# That's all I found so far.
More information about the samba-technical