[Spice-devel] [usbredir PATCH 6/6] usbredirfilter: fix filter parsing for windows (mingw)

Christophe Fergeau cfergeau at redhat.com
Wed May 9 03:07:43 PDT 2012


Hey,

On Mon, May 07, 2012 at 04:30:22PM +0300, Uri Lublin wrote:
> On 05/03/2012 07:09 PM, Christophe Fergeau wrote:
> >On Thu, May 03, 2012 at 06:04:39PM +0300, Uri Lublin wrote:
> >>From: Arnon Gilboa<agilboa at redhat.com>
> >>
> >>no strtok_r (reentrent) available, so use strtok instead.
> >Wouldn't it be safer to use strtok_s? Any application using threads and
> >strtok and libusbredirparser could get issues with this change no?
> >
> 
> It seems mingw32 does not support strtok_s

#include <string.h>

int main (int argc, char **argv)
{
    char *ctxt;
    char *token;
    token = strtok_s("foo", ":", &ctxt);

    return (token != NULL);
}

compiles and links fine on my f17 both with i686-w64-mingw32-gcc -Wall and
x86_64-w64-mingw32-gcc, so using strtok_s should be fine.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120509/66784fce/attachment.pgp>


More information about the Spice-devel mailing list