[USER32] InternalGetWindowText: Write to caller's buffer only when one was provided...
[reactos.git] / win32ss / user / user32 / windows / window.c
index fd00648..388ef25 100644 (file)
@@ -1799,7 +1799,7 @@ int WINAPI
 InternalGetWindowText(HWND hWnd, LPWSTR lpString, int nMaxCount)
 {
     INT Ret = NtUserInternalGetWindowText(hWnd, lpString, nMaxCount);
-    if (Ret == 0)
+    if (Ret == 0 && lpString)
         *lpString = L'\0';
     return Ret;
 }