[HACKERS] Re: Struggling with c functions

2001-04-29 Thread Olivier PRENANT
Many thanks to you!!! It now works (did'nt realize that strings where not null terminated) stupid me!!! Regards, On Sat, 28 Apr 2001, mlw wrote: > You actually almost have it right. > > You are passing VARDATA(user) to crypt, this is wrong. > > You must do something like this: > > int ulen =

[HACKERS] Re: Struggling with c functions

2001-04-28 Thread mlw
You actually almost have it right. You are passing VARDATA(user) to crypt, this is wrong. You must do something like this: int ulen = VARSIZE(user)-VARHDRSZ; char utmp[ulen+]; // This works in newer GCC, cool. memcpy(utmp,VARDATA(user), len); utmp[ulen]=0; crypted=crypt(utmp,salt); Strings are