Changeset 1484 for trunk/src/kernel32/heapstring.cpp
- Timestamp:
- Oct 27, 1999, 8:36:36 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/heapstring.cpp
r1292 r1484 1 /* $Id: heapstring.cpp,v 1.1 5 1999-10-14 17:15:26 phaller Exp $ */1 /* $Id: heapstring.cpp,v 1.16 1999-10-27 18:36:36 phaller Exp $ */ 2 2 3 3 /* … … 570 570 571 571 // asciilen: max length of unicode buffer (including end 0) 572 572 // @@@PH 0 termination is NOT necessarily included ! 573 573 int WIN32API lstrcpynAtoW(LPWSTR unicode, 574 574 LPSTR ascii, … … 583 583 char* in_buf; 584 584 585 dprintf(("KERNEL32: HeapString: lstrcpynAtoW(%s,%08xh )\n",585 dprintf(("KERNEL32: HeapString: lstrcpynAtoW(%s,%08xh,%d)\n", 586 586 ascii, 587 unicode)); 587 unicode, 588 asciilen)); 588 589 589 590 //CB: no input, set at least terminator … … 599 600 if (getUconvObject()) 600 601 { 601 if (asciilen == 1) 602 //@@@PH what's this? 603 if ((asciilen == 1) && (*ascii == '\0') ) 602 604 { 603 605 unicode[0] = 0; … … 606 608 607 609 in_buf = ascii; 608 in_bytes_left = asciilen-1; //buffer size in bytes 610 611 //@@@PH what's this? 612 //in_bytes_left = asciilen-1; //buffer size in bytes 613 614 in_bytes_left = asciilen; //buffer size in bytes 609 615 out_buf = (UniChar*)unicode; 610 616 … … 616 622 &num_subs ); 617 623 618 unicode[asciilen-1-in_bytes_left] = 0; 624 //@@@PH what's this? 625 //unicode[asciilen-1-in_bytes_left] = 0; 619 626 620 627 //if (rc != ULS_SUCCESS && in_bytes_left > 0) //CB: never the case during my tests 621 628 // dprintf(("KERNEL32: AsciiToUnicode failed, %d bytes left!\n",in_bytes_left)); 622 return asciilen - 1; 629 630 //@@@PH what's this? 631 //return asciilen - 1; 632 return asciilen; 623 633 } 624 634 else 625 635 { //poor man's conversion 626 636 627 for(i = 0;i < asciilen-1;i++) 637 // for(i = 0;i < asciilen-1;i++) 638 for(i = 0;i < asciilen;i++) 628 639 { 629 640 unicode[i] = ascii[i]; 630 641 if (ascii[i] == 0) 631 return i-1; //work done 642 //return i-1; //work done 643 return i; //work done 632 644 } 633 645 634 unicode[asciilen-1] = 0; 635 return asciilen-1; 646 // unicode[asciilen-1] = 0; 647 // return asciilen-1; 648 return asciilen; 636 649 } 637 650 } … … 652 665 LPSTR WIN32API lstrcpyWtoA(LPSTR ascii, LPWSTR unicode) 653 666 { 667 //@@@PH huh? wuz dat? 654 668 if (unicode == NULL) 655 669 {
Note:
See TracChangeset
for help on using the changeset viewer.