From bac53a94fec22563294cb57413e8d394df06c70a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 27 May 2014 21:51:01 -0700 Subject: Replace calls to index() with calls to strchr() Both were in use in different functions, adopt the ANSI C standard function for all calls. Signed-off-by: Alan Coopersmith --- psgeom.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/psgeom.c b/psgeom.c index 090e38d..fa2d1d9 100644 --- a/psgeom.c +++ b/psgeom.c @@ -420,37 +420,37 @@ CrackXLFDName(const char *name, FontStuff *stuff) return False; stuff->foundry = tmp; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; stuff->face = tmp; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; stuff->weight = tmp; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; stuff->slant = tmp; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; stuff->setWidth = tmp; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; stuff->variant = tmp; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; @@ -459,7 +459,7 @@ CrackXLFDName(const char *name, FontStuff *stuff) else if (sscanf(tmp, "%i", &stuff->pixelSize) != 1) goto BAILOUT; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; @@ -468,7 +468,7 @@ CrackXLFDName(const char *name, FontStuff *stuff) else if (sscanf(tmp, "%i", &stuff->ptSize) != 1) goto BAILOUT; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; @@ -477,7 +477,7 @@ CrackXLFDName(const char *name, FontStuff *stuff) else if (sscanf(tmp, "%i", &stuff->resX) != 1) goto BAILOUT; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; @@ -486,13 +486,13 @@ CrackXLFDName(const char *name, FontStuff *stuff) else if (sscanf(tmp, "%i", &stuff->resY) != 1) goto BAILOUT; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; stuff->spacing = tmp; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; @@ -501,7 +501,7 @@ CrackXLFDName(const char *name, FontStuff *stuff) else if (sscanf(tmp, "%i", &stuff->avgWidth) != 1) goto BAILOUT; - if ((tmp = index(tmp, '-')) == NULL) + if ((tmp = strchr(tmp, '-')) == NULL) goto BAILOUT; else *tmp++ = '\0'; -- cgit v1.2.3