Skip to contentSkip to conversation

dont use obsolete index() function in lxdialog

PATCH Applied Mike Frysinger 2 participants 2 messages Mar 17, 2007 Kconfig

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dont use obsolete index() function in lxdialog

The index() function is obsolete, use strchr() instead.

---

scripts/kconfig/lxdialog/util.c +2 -2
@@ -336,7 +336,7 @@
 		newl = 1;
 		word = tempstr;
 		while (word && *word) {
-			sp = index(word, ' ');
+			sp = strchr(word, ' ');
 			if (sp)
 				*sp++ = 0;
 
@@ -348,7 +348,7 @@
 			if (wlen > room ||
 			    (newl && wlen < 4 && sp
 			     && wlen + 1 + strlen(sp) > room
-			     && (!(sp2 = index(sp, ' '))
+			     && (!(sp2 = strchr(sp, ' '))
 				 || wlen + 1 + (sp2 - sp) > room))) {
 				cur_y++;
 				cur_x = x;
Applied
#1 lore raw
Quoted 1 line · Mike Frysinger

The index() function is obsolete, use strchr() instead.

Thanks, applied.

Sam