Hi Henrik,

At 11.49 26/04/2006, Henrik Nordstrom wrote:
>
> Cool. Can I just use it then [are you happy to make the compatability
> library ?]

Here is one suggestion:


#include <string.h>

char *strtok_r(char *str, const char *delim, char **saveptr)
{
    char *token;
    if (str)
        *saveptr = str;
    token = *saveptr;

    if (!token)
        return NULL;

    token += strspn(token, delim);
    *saveptr = strpbrk(token, delim);
    if (*saveptr)
        *(*saveptr)++ = '\0';

    return *token ? token : NULL;
}

Or what about this one ?

http://www.koders.com/c/fid3F7CD99A2330F1C4597E40E95EC1F2ABF7D3585C.aspx?s=strtok_r
http://www.koders.com/c/fidB5BB2AC1E8C46149D409AEE6639912F088F6DF3D.aspx?s=strtok_r

Regards

Guido



-
========================================================
Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1           10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135  Fax. : +39.011.9781115
Email: [EMAIL PROTECTED]
WWW: http://www.acmeconsulting.it/

Reply via email to