mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-09 12:23:39 -04:00
fixed int messiness
This commit is contained in:
parent
ee1ca9b844
commit
65fd6009a2
@ -31,15 +31,16 @@ void spacePrint( ostream& os,
|
|||||||
int indentSpaces,
|
int indentSpaces,
|
||||||
int secondLineOffset )
|
int secondLineOffset )
|
||||||
{
|
{
|
||||||
if ( (s.length() + indentSpaces > (unsigned int) maxWidth) &&
|
int len = (int)(s.length());
|
||||||
maxWidth > 0 )
|
|
||||||
|
if ( (len + indentSpaces > maxWidth) && maxWidth > 0 )
|
||||||
{
|
{
|
||||||
int allowedLen = maxWidth - indentSpaces;
|
int allowedLen = maxWidth - indentSpaces;
|
||||||
int start = 0;
|
int start = 0;
|
||||||
while ( (unsigned int)start < s.length() )
|
while ( start < len )
|
||||||
{
|
{
|
||||||
// find the substring length
|
// find the substring length
|
||||||
int stringLen = min( s.length() - start, (unsigned int)allowedLen );
|
int stringLen = min( len - start, allowedLen );
|
||||||
|
|
||||||
// trim the length so it doesn't end in middle of a word
|
// trim the length so it doesn't end in middle of a word
|
||||||
if ( stringLen == allowedLen )
|
if ( stringLen == allowedLen )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user