Re: [spice-gtk v3 2/2] mingw: Fix compilation breakage because of memmem use

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

 



> 
> On Thu, Oct 4, 2018 at 12:30 PM Christophe Fergeau <cfergeau@xxxxxxxxxx>
> wrote:
> >
> > mingw does not provide memmem. Since the qmp data is JSON, it won't
> > contain embedded nul characters, we can use strstr instead of
> > memmem.
> >
> > Signed-off-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
> 
> ack
> 

CI thanks,
https://gitlab.freedesktop.org/spice/spice-gtk/pipelines/5270

Frediano

> > ---
> > - add explicit check for NULL to match coding style
> >
> >  src/qmp-port.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/qmp-port.c b/src/qmp-port.c
> > index c91f967a..d3a08ece 100644
> > --- a/src/qmp-port.c
> > +++ b/src/qmp-port.c
> > @@ -160,7 +160,7 @@ spice_qmp_handle_port_data(SpiceQmpPort *self, gpointer
> > data,
> >      }
> >
> >      str = qmp->str;
> > -    while ((crlf = memmem(str, qmp->len - (str - qmp->str), "\r\n", 2))) {
> > +    while ((crlf = strstr(str, "\r\n")) != NULL) {
> >          GError *err = NULL;
> >
> >          *crlf = '\0';
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]