1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

RJK's OS X portability patch:

- initialise blank mbstate_t using memset rather than an ad-hoc
   initialiser.
 - expand the OMIT_UTMP ifdefs to enclose a load of entire functions
   that would generate `static function never called' warnings if
   left as empty shells.
 - couple of other fiddly things.

[originally from svn r4896]
This commit is contained in:
Simon Tatham
2004-11-24 11:36:08 +00:00
parent d387cda9b0
commit 4f197b872e
2 changed files with 22 additions and 15 deletions

View File

@ -26,8 +26,9 @@ int mb_to_wc(int codepage, int flags, char *mbstr, int mblen,
{
if (codepage == DEFAULT_CODEPAGE) {
int n = 0;
mbstate_t state = { 0 };
mbstate_t state;
memset(&state, 0, sizeof state);
setlocale(LC_CTYPE, "");
while (mblen > 0) {
@ -68,9 +69,10 @@ int wc_to_mb(int codepage, int flags, wchar_t *wcstr, int wclen,
if (codepage == DEFAULT_CODEPAGE) {
char output[MB_LEN_MAX];
mbstate_t state = { 0 };
mbstate_t state;
int n = 0;
memset(&state, 0, sizeof state);
setlocale(LC_CTYPE, "");
while (wclen > 0) {