]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
build: avoid obsolete index()
authorEric Blake <eblake@redhat.com>
Thu, 23 Apr 2015 14:13:53 +0000 (08:13 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 23 Apr 2015 14:15:55 +0000 (08:15 -0600)
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>
src/util/virstring.c

index 1cd49876fe85a17f648182f7ab89b3ef87a04574..7b0cad754009ba82ce7733e713b9bf16aefb45ea 100644 (file)
@@ -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];