Do not loop forever if there is a nonprintable character in the format.

pull/1731/head
nicm 2019-04-24 20:27:52 +00:00 committed by Nicholas Marriott
parent 750d5830c2
commit 901eed7b71
1 changed files with 4 additions and 2 deletions

View File

@ -837,7 +837,8 @@ format_trim_left(const char *expanded, u_int limit)
*out++ = *cp;
width++;
cp++;
}
} else
cp++;
}
*out = '\0';
return (copy);
@ -883,7 +884,8 @@ format_trim_right(const char *expanded, u_int limit)
*out++ = *cp;
width++;
cp++;
}
} else
cp++;
}
*out = '\0';
return (copy);