Changeset 250 for trunk/src/kernel32/KERNEL32.CPP
- Timestamp:
- Jun 30, 1999, 3:25:28 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.CPP
r233 r250 1 /* $Id: KERNEL32.CPP,v 1. 8 1999-06-28 07:55:16sandervl Exp $ */1 /* $Id: KERNEL32.CPP,v 1.9 1999-06-30 13:25:01 sandervl Exp $ */ 2 2 3 3 /* … … 14 14 * Copyright 1998 Knut St. Osmundsen 15 15 * 16 * @(#) KERNEL32.CPP 1.0.1 16 * @(#) KERNEL32.CPP 1.0.1 1998/06/12 PH added HandleManager support 17 17 */ 18 18 … … 699 699 //PH: looks like either \0 or arg3 terminate the copy 700 700 //return strncpy(arg1, arg2, arg3); 701 for (;*p2 && arg3; arg3--)701 for (;*p2 && (arg3 > 1); arg3--) 702 702 *p1++ = *p2++; 703 703 704 *p1 = 0; //CB: copy arg-1, set end 0 705 704 706 return arg1; 705 707 } … … 709 711 { 710 712 dprintf(("KERNEL32: OS2lstrcpynW")); 711 UniStrncpy( (UniChar*)dest, (UniChar*)src, arg3 ); 713 if (arg3 == 0) return NULL; 714 UniStrncpy( (UniChar*)dest, (UniChar*)src, arg3-1); //CB: copy arg3-1 characters 715 dest[arg3-1] = 0; //CB: set end 712 716 return dest; 713 717 } … … 1155 1159 1156 1160 1161
Note:
See TracChangeset
for help on using the changeset viewer.