[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why does string.format() limit width to two digits?
- From: Mouse <mouse@...>
- Date: Thu, 19 Jan 2023 12:45:01 -0500 (EST)
>> The width in %45s is used to right-justify the string by padding on
>> the left with spaces.
> My point was that I can well imagine use cases where someone do want
> to right-justify a, say, 150 char string in a 200 char field, [...]
I don't know what Luiz meant to be replying to, but it does occur to me
that Roberto wrote of "a simple a secure way to [...] avoid buffer
overflow", and pointing out that the field width does not limit the
printed string length _is_ a valid point in response to _that_. The
"avoid buffer overflow" text got lost somewhere in the quoting in what
I saw, though, so even if that was the point it may not have been
apparent.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B