Phil Krylov : riched20: Allow NUL characters.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Jan 10 14:14:00 CST 2006
Module: wine
Branch: refs/heads/master
Commit: f5ebb75f08f5d417b38fe1ce84f13a6240611bdd
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=f5ebb75f08f5d417b38fe1ce84f13a6240611bdd
Author: Phil Krylov <phil at newstar.rinet.ru>
Date: Tue Jan 10 19:58:00 2006 +0100
riched20: Allow NUL characters.
---
dlls/riched20/string.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/riched20/string.c b/dlls/riched20/string.c
index c9057bf..6d23e2f 100644
--- a/dlls/riched20/string.c
+++ b/dlls/riched20/string.c
@@ -40,13 +40,13 @@ ME_String *ME_MakeString(LPCWSTR szText)
ME_String *ME_MakeStringN(LPCWSTR szText, int nMaxChars)
{
ME_String *s = ALLOC_OBJ(ME_String);
- int i;
- for (i=0; i<nMaxChars && szText[i]; i++)
- ;
- s->nLen = i;
+
+ s->nLen = nMaxChars;
s->nBuffer = ME_GetOptimalBuffer(s->nLen+1);
s->szData = ALLOC_N_OBJ(WCHAR, s->nBuffer);
- lstrcpynW(s->szData, szText, s->nLen+1);
+ /* Native allows NUL chars */
+ memmove(s->szData, szText, s->nLen * sizeof(WCHAR));
+ s->szData[s->nLen] = 0;
return s;
}
More information about the wine-cvs
mailing list