diff lwlib/lwlib-fonts.c @ 5335:c9d31263ab7d

Replace POSIX index(3) with C89 strchr(3), lwlib-fonts.c 2011-01-11 Aidan Kehoe <kehoea@parhasard.net> * lwlib-fonts.c (xft_open_font_by_name): Replace the POSIX index(3), not universally available even today, with the C89 strchr(3), hopefully fixing a few of the buildbots' problems.
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 11 Jan 2011 13:39:35 +0000
parents a6c778975d7d
children 7ebbe334061e
line wrap: on
line diff
--- a/lwlib/lwlib-fonts.c	Mon Jan 10 20:00:57 2011 +0000
+++ b/lwlib/lwlib-fonts.c	Tue Jan 11 13:39:35 2011 +0000
@@ -76,7 +76,7 @@
   int count = 0;
   char *pos = name;
   /* extra parens shut up gcc */
-  while ((pos = index (pos, '-')))
+  while ((pos = strchr (pos, '-')))
     {
       count++;
       pos++;
@@ -86,7 +86,7 @@
   if (count == 14		/* fully-qualified XLFD */
       || (count < 14		/* heuristic for wildcarded XLFD */
 	  && count >= 5
-	  && index (name, '*')))
+	  && strchr (name, '*')))
     res = XftFontOpenXlfd (dpy, DefaultScreen (dpy), name);
   else
     res = XftFontOpenName (dpy, DefaultScreen (dpy), name);