[Toybox] [PATCH] Fix wcwidth(3) on Mac.

Rob Landley rob at landley.net
Sat Nov 23 08:19:25 PST 2019


On 11/23/19 10:17 AM, Rob Landley wrote:
> Hmmm... maybe it can do this as the fallback?
> 
>   if (!setlocale("c.utf8")) setlocale("");
> 
> (This is _so_ not my area of expertise, happy to be corrected here. But I want
> utf8 support in initramfs or booting from a rescue USB stick where I haven't got
> a full environment set up yet, which is why it was doing that in the first place...)

The reason I wasn't doing this before is I know how utf8 behaves so I can know
it won't overflow buffers and such, but arbitrary encoding du jour that's _not_
UTF8? Could be exploitable. I don't know. I'd have to audit everything all over
again...

Rob



More information about the Toybox mailing list