+Fri Jun 15 14:42:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
+
+ * src/test.c, src/virsh.c, src/xend_internal.c, src/xm_internal.c:
+ Replace calls to deprecated {,r}index with str{,r}chr.
+
Fri Jun 15 08:53:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/internal.h, src/virsh.c: Replace _N with N_ so that
if (!strncmp(line, "processor\t", 10)) { /* aka a single logical CPU */
(*cpus)++;
} else if (!strncmp(line, "cpu MHz\t", 8)) {
- char *offset = index(line, ':');
+ char *offset = strchr(line, ':');
if (!offset)
continue;
offset++;
*mhz = (unsigned int)strtol(offset, NULL, 10);
} else if (!strncmp(line, "physical id\t", 12)) { /* aka socket */
unsigned int id;
- char *offset = index(line, ':');
+ char *offset = strchr(line, ':');
if (!offset)
continue;
offset++;
*sockets = (id + 1);
} else if (!strncmp(line, "cpu cores\t", 9)) { /* aka cores */
unsigned int id;
- char *offset = index(line, ':');
+ char *offset = strchr(line, ':');
if (!offset)
continue;
offset++;
*/
/* Extract the source */
- if (!(offset = index(head, ',')) || offset[0] == '\0')
+ if (!(offset = strchr(head, ',')) || offset[0] == '\0')
goto skipdisk;
if ((offset - head) >= (PATH_MAX-1))
goto skipdisk;
head = offset + 1;
/* Extract the dest */
- if (!(offset = index(head, ',')) || offset[0] == '\0')
+ if (!(offset = strchr(head, ',')) || offset[0] == '\0')
goto skipdisk;
if ((offset - head) >= (PATH_MAX-1))
goto skipdisk;
/* Extract source driver type */
- if (!(tmp = index(src, ':')) || !tmp[0])
+ if (!(tmp = strchr(src, ':')) || !tmp[0])
goto skipdisk;
strncpy(drvName, src, (tmp-src));
drvName[tmp-src] = '\0';
/* And the source driver sub-type */
if (!strncmp(drvName, "tap", 3)) {
- if (!(tmp1 = index(tmp+1, ':')) || !tmp1[0])
+ if (!(tmp1 = strchr(tmp+1, ':')) || !tmp1[0])
goto skipdisk;
strncpy(drvType, tmp+1, (tmp1-(tmp+1)));
memmove(src, src+(tmp1-src)+1, strlen(src)-(tmp1-src));
}
/* Check for a :cdrom/:disk postfix */
- if ((tmp = index(dev, ':')) != NULL) {
+ if ((tmp = strchr(dev, ':')) != NULL) {
if (!strcmp(tmp, ":cdrom"))
cdrom = 1;
tmp[0] = '\0';
key = list->str;
while (key) {
char *data;
- char *nextkey = index(key, ',');
+ char *nextkey = strchr(key, ',');
- if (!(data = index(key, '=')) || (data[0] == '\0'))
+ if (!(data = strchr(key, '=')) || (data[0] == '\0'))
goto skipnic;
data++;
while (key) {
char *data;
- char *nextkey = index(key, ',');
+ char *nextkey = strchr(key, ',');
char *end = nextkey;
if (nextkey) {
*end = '\0';
nextkey++;
}
- if (!(data = index(key, '=')) || (data[0] == '\0'))
+ if (!(data = strchr(key, '=')) || (data[0] == '\0'))
break;
data++;