summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/argp-parse.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-11 18:50:58 +0000
committerMiles Bader <miles@gnu.org>1997-02-11 18:50:58 +0000
commit86dacbe0cae966275989a0fc0afbea2286e29874 (patch)
tree23625fb3775d9d555e8f9c88331fa92b2f398a31 /libshouldbeinlibc/argp-parse.c
parent86d0250163442644c3338e249a27a28f3749576a (diff)
(argp_default_parser):
Use strrchr instead of rindex. (argp_parse): Use strchr instead of index, memset instead of bzero.
Diffstat (limited to 'libshouldbeinlibc/argp-parse.c')
-rw-r--r--libshouldbeinlibc/argp-parse.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libshouldbeinlibc/argp-parse.c b/libshouldbeinlibc/argp-parse.c
index aa3270c1..75ff1479 100644
--- a/libshouldbeinlibc/argp-parse.c
+++ b/libshouldbeinlibc/argp-parse.c
@@ -86,7 +86,7 @@ argp_default_parser (int key, char *arg, struct argp_state *state)
case OPT_PROGNAME: /* Set the program name. */
program_invocation_name = arg;
- program_invocation_short_name = rindex (arg, '/');
+ program_invocation_short_name = strrchr (arg, '/');
if (program_invocation_short_name)
program_invocation_short_name++;
else
@@ -303,7 +303,7 @@ argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
/* By comparing OPT's position in SHORT_OPTS to the various
starting positions in each group's SHORT_END field, we can
determine which group OPT came from. */
- char *short_index = index (short_opts, opt);
+ char *short_index = strchr (short_opts, opt);
if (short_index)
for (group = groups; group < egroup; group++)
if (group->short_end > short_index)
@@ -330,10 +330,10 @@ argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
/* TOP_ARGP has no options, it just serves to group the user & default
argps. */
- bzero (top_argp, sizeof (*top_argp));
+ memset (top_argp, 0, sizeof (*top_argp));
top_argp->children = kids;
- bzero (kids, 4 * sizeof (struct argp_child));
+ memset (kids, 0, 4 * sizeof (struct argp_child));
if (state.argp)
(kids++)->argp = state.argp;
(kids++)->argp = &argp_default_argp;
@@ -501,7 +501,7 @@ argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
groups = alloca ((num_groups + 1) * sizeof (struct group));
child_inputs = alloca (num_child_inputs * sizeof (void *));
- bzero (child_inputs, num_child_inputs * sizeof (void *));
+ memset (child_inputs, 0, num_child_inputs * sizeof (void *));
if (state.argp)
egroup = convert_options (state.argp, 0, 0, groups);