diff options
author | Andrey Borzenkov <bor@users.sourceforge.net> | 2005-02-22 21:36:40 +0000 |
---|---|---|
committer | Andrey Borzenkov <bor@users.sourceforge.net> | 2005-02-22 21:36:40 +0000 |
commit | 70f927906088e90f25442e236d7d5e063bfc18ff (patch) | |
tree | 68ae38160e0fe69b505611bb016b24da6be88414 /Src/Zle/zle_utils.c | |
parent | 85b63c0c0382310460bd616db583c16d1046eead (diff) | |
download | zsh-70f927906088e90f25442e236d7d5e063bfc18ff.tar.gz zsh-70f927906088e90f25442e236d7d5e063bfc18ff.tar.xz zsh-70f927906088e90f25442e236d7d5e063bfc18ff.zip |
20845: fix mbstate_t usage in getrestchar
Diffstat (limited to 'Src/Zle/zle_utils.c')
-rw-r--r-- | Src/Zle/zle_utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index a5fe799eb..8d38c4752 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -116,8 +116,8 @@ zlelineasstring(ZLE_STRING_T instr, int inll, int incs, int *outll, s = zalloc(inll * MB_CUR_MAX + 1); - for(i=0; i < inll; i++) { - if (outcs != NULL && i == incs) + for(i=0; i < inll; i++, incs--) { + if (outcs != NULL && incs == 0) *outcs = mb_len; j = wctomb(s + mb_len, instr[i]); if (j == -1) { @@ -206,7 +206,7 @@ stringaszleline(unsigned char *instr, int *outll, int *outsz) wchar_t *outptr = outstr; /* mbrtowc(outstr, &cnull, 1, &ps); */ - memset(&ps, \0, sizeof(ps)); + memset(&ps, '\0', sizeof(ps)); while (ll) { size_t ret = mbrtowc(outptr, inptr, ll, &ps); |