1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

man-generator: fix buffer length calculation

This commit is contained in:
Heinz Mauelshagen 2017-03-24 18:33:03 +01:00
parent 25c841af00
commit d823c65d50

View File

@ -2299,7 +2299,7 @@ static void print_def_man(struct command_name *cname, int opt_enum, struct arg_d
static const char *_emit_long_opt_name(char *buf, const char *long_opt_name, size_t len) static const char *_emit_long_opt_name(char *buf, const char *long_opt_name, size_t len)
{ {
strcpy(buf, "\\-\\-"); strcpy(buf, "\\-\\-");
strncat(buf, long_opt_name + 2, strlen(buf) - 1); strncat(buf, long_opt_name + 2, len - strlen(buf) - 1);
return buf; return buf;
} }