summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-27 21:51:01 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-27 21:51:08 -0700
commitbac53a94fec22563294cb57413e8d394df06c70a (patch)
tree2effd3e116169493abd3f1afaac060428294f154
parent5ee01f266fd315e5bee624ec9d54357ffa593dfc (diff)
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 <alan.coopersmith@oracle.com>
-rw-r--r--psgeom.c24
1 files 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';