Return 0 length line as 0 length line for EM_GETLINE.

This commit is contained in:
Vitaliy Margolen 2005-10-18 12:01:38 +00:00 committed by Alexandre Julliard
parent 4be0d76397
commit cfbd78d659
1 changed files with 1 additions and 1 deletions

View File

@ -2741,7 +2741,7 @@ static INT EDIT_EM_GetLine(EDITSTATE *es, INT line, LPWSTR dst, BOOL unicode)
else else
{ {
INT ret = WideCharToMultiByte(CP_ACP, 0, src, line_len, (LPSTR)dst, dst_len, NULL, NULL); INT ret = WideCharToMultiByte(CP_ACP, 0, src, line_len, (LPSTR)dst, dst_len, NULL, NULL);
if(!ret) /* Insufficient buffer size */ if(!ret && line_len) /* Insufficient buffer size */
return dst_len; return dst_len;
if(ret < dst_len) /* Append 0 if enough space */ if(ret < dst_len) /* Append 0 if enough space */
((LPSTR)dst)[ret] = 0; ((LPSTR)dst)[ret] = 0;