From 86dacbe0cae966275989a0fc0afbea2286e29874 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 11 Feb 1997 18:50:58 +0000 Subject: (argp_default_parser): Use strrchr instead of rindex. (argp_parse): Use strchr instead of index, memset instead of bzero. --- libshouldbeinlibc/argp-parse.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libshouldbeinlibc/argp-parse.c') 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); -- cgit v1.2.3