mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 11:52:20 +00:00
build: avoid obsolete index()
Commit 2a530a3e5 is not portable to mingw, which intentionally avoids declaring the obsolete index(). See also: https://bugzilla.redhat.com/show_bug.cgi?id=1214605 * src/util/virstring.c (virStringStripControlChars): Use strchr. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
236d5bc34d
commit
1268820a63
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012-2014 Red Hat, Inc.
|
* Copyright (C) 2012-2015 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -1003,7 +1003,7 @@ virStringStripControlChars(char *str)
|
|||||||
|
|
||||||
len = strlen(str);
|
len = strlen(str);
|
||||||
for (i = 0, j = 0; i < len; i++) {
|
for (i = 0, j = 0; i < len; i++) {
|
||||||
if (index(control_chars, str[i]))
|
if (strchr(control_chars, str[i]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
str[j++] = str[i];
|
str[j++] = str[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user