[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strtok_r in glibc 2.0.7 bugginess



"Brandon S. Allbery KF8NH" <allbery@kf8nh.apk.net> writes:
> In message <5llnikn4ax.fsf@assaris.sics.se>, Assar Westerlund writes:
> +-----
> | I think the error actually happens when using a constant string.  Can
> | you try the appended patch and if it solves the problem for you?
> +--->8
> 
> Correct, and that's the fix I used with both heimdal and kth-krb4 (strdup() 
> the first parameter).

Yeah, I fixed that a long time ago in kth-krb4 but didn't remember to
do the same thing in heimdal then :-(

> strtok() and strtok_r() are really pre-ANSI and in my experience are best 
> avoided.

strtok() is ANSI but not reentrant, but I find strtok_r useful quite
often.  What do you use instead?  strsep?

/assar