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

Uri Lublin uril at redhat.com
Wed May 9 04:19:26 PDT 2012


On 05/09/2012 01:07 PM, Christophe Fergeau wrote:
> 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.
>

On my f16 neither of those mingw gcc executables are available.

I'll send a simple patch using strtok_s for Windows

Thanks,
     Uri.




More information about the Spice-devel mailing list