4 * Copyright 1993 Yngvi Sigurjonsson
5 * Copyright 1996 Alexandre Julliard
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include "wine/winbase16.h"
30 #include "wine/exception.h"
31 #include "wine/unicode.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(string
);
39 /***********************************************************************
40 * lstrcpyn (KERNEL32.@)
41 * lstrcpynA (KERNEL32.@)
43 * Note: this function differs from the UNIX strncpy, it _always_ writes
46 * Note: n is an INT but Windows treats it as unsigned, and will happily
47 * copy a gazillion chars if n is negative.
49 LPSTR WINAPI
lstrcpynA( LPSTR dst
, LPCSTR src
, INT n
)
54 TRACE("(%p, %s, %i)\n", dst
, debugstr_a(src
), n
);
56 /* In real windows the whole function is protected by an exception handler
57 * that returns ERROR_INVALID_PARAMETER on faulty parameters
58 * We currently just check for NULL.
61 SetLastError(ERROR_INVALID_PARAMETER
);
64 while ((count
> 1) && *src
)
74 /***********************************************************************
75 * lstrcpynW (KERNEL32.@)
77 * Note: this function differs from the UNIX strncpy, it _always_ writes
80 * Note: n is an INT but Windows treats it as unsigned, and will happily
81 * copy a gazillion chars if n is negative.
83 LPWSTR WINAPI
lstrcpynW( LPWSTR dst
, LPCWSTR src
, INT n
)
88 TRACE("(%p, %s, %i)\n", dst
, debugstr_w(src
), n
);
90 /* In real windows the whole function is protected by an exception handler
91 * that returns ERROR_INVALID_PARAMETER on faulty parameters
92 * We currently just check for NULL.
95 SetLastError(ERROR_INVALID_PARAMETER
);
98 while ((count
> 1) && *src
)