From: Eric Blake Date: Thu, 23 Apr 2015 14:13:53 +0000 (-0600) Subject: build: avoid obsolete index() X-Git-Tag: v1.2.15-rc1~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1268820a632846267b75432dc155779a716e289c;p=thirdparty%2Flibvirt.git 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 --- diff --git a/src/util/virstring.c b/src/util/virstring.c index 1cd49876fe..7b0cad7540 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -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 * modify it under the terms of the GNU Lesser General Public @@ -1003,7 +1003,7 @@ virStringStripControlChars(char *str) len = strlen(str); for (i = 0, j = 0; i < len; i++) { - if (index(control_chars, str[i])) + if (strchr(control_chars, str[i])) continue; str[j++] = str[i];