- Timestamp:
- Oct 23, 2000, 9:35:11 PM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/conbuffer.cpp
r4502 r4525 1 /* $Id: conbuffer.cpp,v 1.1 3 2000-10-20 11:46:44sandervl Exp $ */1 /* $Id: conbuffer.cpp,v 1.14 2000-10-23 19:35:09 sandervl Exp $ */ 2 2 3 3 /* … … 2538 2538 2539 2539 /* Ascii -> unicode translation */ 2540 pszAscii = (LPSTR)HEAP_malloc(cchToWrite );2540 pszAscii = (LPSTR)HEAP_malloc(cchToWrite+1); 2541 2541 if (pszAscii == NULL) 2542 2542 return ERROR_NOT_ENOUGH_MEMORY; 2543 2543 2544 lstrcpynWtoA(pszAscii, (LPWSTR)lpvBuffer, cchToWrite );2544 lstrcpynWtoA(pszAscii, (LPWSTR)lpvBuffer, cchToWrite+1); 2545 2545 2546 2546 /* simply forward the request to that routine */ -
trunk/src/kernel32/conin.cpp
r4502 r4525 1 /* $Id: conin.cpp,v 1.1 3 2000-10-20 11:46:45sandervl Exp $ */1 /* $Id: conin.cpp,v 1.14 2000-10-23 19:35:10 sandervl Exp $ */ 2 2 3 3 /* … … 37 37 #include <misc.h> 38 38 #include <string.h> 39 #include <stdlib.h> 39 40 40 41 #include "conwin.h" // Windows Header for console only … … 745 746 /* Ascii -> unicode translation */ 746 747 if (dwResult == TRUE) 747 lstrcpynAtoW((LPWSTR)lpvBuffer, lpstrAscii, *lpcchRead);748 lstrcpynAtoW((LPWSTR)lpvBuffer, lpstrAscii, min(cchToRead, *lpcchRead+1)); 748 749 749 750 HEAP_free(lpstrAscii); -
trunk/src/kernel32/console.cpp
r4502 r4525 1 /* $Id: console.cpp,v 1.2 2 2000-10-20 11:46:46sandervl Exp $ */1 /* $Id: console.cpp,v 1.23 2000-10-23 19:35:10 sandervl Exp $ */ 2 2 3 3 /* … … 3772 3772 lstrcpynWtoA(ConsoleGlobals.pszWindowTitle, 3773 3773 lpszTitle, 3774 iLength );3774 iLength+1); //must add one (lstrcpynWtoA terminates string) 3775 3775 3776 3776 WinSetWindowText(ConsoleGlobals.hwndFrame, /* set new title text */ -
trunk/src/kernel32/heapstring.cpp
r4363 r4525 1 /* $Id: heapstring.cpp,v 1.3 3 2000-10-02 13:05:37 phallerExp $ */1 /* $Id: heapstring.cpp,v 1.34 2000-10-23 19:35:11 sandervl Exp $ */ 2 2 3 3 /* … … 493 493 UniChar* in_buf; 494 494 char* out_buf; 495 496 dprintf2(("KERNEL32: HeapString: lstrcpynWtoA(%08x,%08xh,%d)\n", 497 astring, 498 ustring, 499 unilen)); 495 500 496 501 if (ustring == NULL) … … 552 557 } 553 558 559 //lstrcpynWtoA and lstrcpynAtoW must zero-terminate the string 560 //because Wine code depends on this behaviour (i.e. comdlg32) 554 561 int WIN32API lstrcpynWtoA(LPSTR astring, 555 562 LPCWSTR ustring, 556 563 int unilen) 557 564 { 558 return lstrcpynCtoA(astring, ustring, unilen, GetWindowsUconvObject()); 565 int ret; 566 567 ret = lstrcpynCtoA(astring, ustring, unilen, GetWindowsUconvObject()); 568 astring[unilen-1] = 0; 569 return ret; 559 570 } 560 571 … … 660 671 } 661 672 673 //lstrcpynWtoA and lstrcpynAtoW must zero-terminate the string 674 //because Wine code depends on this behaviour (i.e. comdlg32) 662 675 int WIN32API lstrcpynAtoW(LPWSTR unicode, 663 676 LPCSTR ascii, 664 677 int asciilen) 665 678 { 666 return lstrcpynAtoC(unicode, ascii, asciilen, GetWindowsUconvObject()); 679 int ret; 680 681 ret = lstrcpynAtoC(unicode, ascii, asciilen, GetWindowsUconvObject()); 682 unicode[asciilen-1] = 0; 683 return ret; 667 684 } 668 685
Note:
See TracChangeset
for help on using the changeset viewer.