summaryrefslogtreecommitdiff
path: root/argp/argp-help.c
diff options
context:
space:
mode:
Diffstat (limited to 'argp/argp-help.c')
-rw-r--r--argp/argp-help.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/argp/argp-help.c b/argp/argp-help.c
index d78060d12c..f5d96fb1ef 100644
--- a/argp/argp-help.c
+++ b/argp/argp-help.c
@@ -1376,19 +1376,17 @@ argp_args_usage (const struct argp *argp, const struct argp_state *state,
if (fdoc)
{
const char *cp = fdoc;
- nl = strchr (cp, '\n');
- if (nl)
+ nl = __strchrnul (cp, '\n');
+ if (*nl != '\0')
/* This is a `multi-level' args doc; advance to the correct position
as determined by our state in LEVELS, and update LEVELS. */
{
int i;
multiple = 1;
for (i = 0; i < *our_level; i++)
- cp = nl + 1, nl = strchr (cp, '\n');
+ cp = nl + 1, nl = __strchrnul (cp, '\n');
(*levels)++;
}
- if (! nl)
- nl = cp + strlen (cp);
/* Manually do line wrapping so that it (probably) won't get wrapped at
any embedded spaces. */