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

command: refactor loop test for end of string

This commit is contained in:
Zdenek Kabelac 2024-04-27 13:04:25 +02:00
parent e1211d38a4
commit 0316dd7955
2 changed files with 3 additions and 5 deletions

View File

@ -1596,7 +1596,7 @@ static void _print_usage_description(struct command *cmd)
unsigned di = 0;
int bi = 0;
for (di = 0; di < strlen(desc); di++) {
for (di = 0; desc[di]; di++) {
if (!strncmp(&desc[di], "DESC:", 5)) {
if (bi) {
buf[bi] = '\0';

View File

@ -993,7 +993,7 @@ static void _print_man_option_desc(struct command_name *cname, int opt_enum)
return;
}
for (di = 0; di < strlen(desc); di++) {
for (di = 0; desc[di]; di++) {
buf[bi++] = desc[di];
if (bi == DESC_LINE) {
@ -1318,9 +1318,7 @@ static void _print_desc_man(const char *desc)
unsigned di;
int bi = 0;
for (di = 0; di < strlen(desc); di++) {
if (desc[di] == '\0')
break;
for (di = 0; desc[di]; di++) {
if (desc[di] == '\n')
continue;