summaryrefslogtreecommitdiff
path: root/wcwidth.c (follow)
Commit message (Collapse)AuthorAge
* Fix two potential buffer under/overruns.Simon Tatham2017-05-14
| | | | | | | | | | | | | The one in wcwidth.c actually came up in one of my valgrind runs: if you passed it a non-null-terminated wide string (specifically, one that reaches invalid memory exactly when the length parameter runs out), it would illegally load the character beyond the end of the string before noticing that the length parameter said it shouldn't. The one in bk_man.c may well not be able to come up at all, but I spotted it in passing and I thought I might as well fix it - it makes me twitch on general principles to see any use of buf[len-1] without having checked len>0 first.
* Remove a bunch of unused variables spotted by Ubuntu 12.04's gcc.Simon Tatham2012-05-03
| | | | [originally from svn r9478]
* bk_text and bk_info both need to know the on-screen width ofSimon Tatham2004-04-22
characters in order to wrap and align them properly. Therefore, they should be using wcwidth(). So here are a couple of wrappers on wcwidth(), one which filters out the Unicode characters not representable in the target charset, and one which converts _from_ a charset to Unicode before calling wcwidth(). bk_text and bk_info should now align correctly even in the face of unsupported characters and Japanese. [originally from svn r4116]