mingw: Fix compilation breakage because of memmem use

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@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@gmail.com>
This commit is contained in:
Christophe Fergeau 2018-10-04 10:30:31 +02:00 committed by Frediano Ziglio
parent a2ffc3e9ba
commit d1e9df19f5

View File

@ -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';