Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a6af1f76
Commit
a6af1f76
authored
Jan 30, 1999
by
Marcus Meissner
Committed by
Alexandre Julliard
Jan 30, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for NULL in lstrcpy* (Windows uses real exception handlers).
parent
01797f2f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
string.c
memory/string.c
+32
-4
No files found.
memory/string.c
View file @
a6af1f76
...
@@ -247,7 +247,14 @@ SEGPTR WINAPI lstrcpy16( SEGPTR dst, LPCSTR src )
...
@@ -247,7 +247,14 @@ SEGPTR WINAPI lstrcpy16( SEGPTR dst, LPCSTR src )
LPSTR
WINAPI
lstrcpy32A
(
LPSTR
dst
,
LPCSTR
src
)
LPSTR
WINAPI
lstrcpy32A
(
LPSTR
dst
,
LPCSTR
src
)
{
{
TRACE
(
string
,
"strcpy %s
\n
"
,
debugstr_a
(
src
));
TRACE
(
string
,
"strcpy %s
\n
"
,
debugstr_a
(
src
));
/* Windows does not check for NULL pointers here, so we don't either */
/* In real windows the whole function is protected by an exception handler
* that returns ERROR_INVALID_PARAMETER on faulty parameters
* We currently just check for NULL.
*/
if
(
!
dst
||
!
src
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
strcpy
(
dst
,
src
);
strcpy
(
dst
,
src
);
return
dst
;
return
dst
;
}
}
...
@@ -260,7 +267,14 @@ LPWSTR WINAPI lstrcpy32W( LPWSTR dst, LPCWSTR src )
...
@@ -260,7 +267,14 @@ LPWSTR WINAPI lstrcpy32W( LPWSTR dst, LPCWSTR src )
{
{
register
LPWSTR
p
=
dst
;
register
LPWSTR
p
=
dst
;
TRACE
(
string
,
"strcpy L%s
\n
"
,
debugstr_w
(
src
));
TRACE
(
string
,
"strcpy L%s
\n
"
,
debugstr_w
(
src
));
/* Windows does not check for NULL pointers here, so we don't either */
/* In real windows the whole function is protected by an exception handler
* that returns ERROR_INVALID_PARAMETER on faulty parameters
* We currently just check for NULL.
*/
if
(
!
dst
||
!
src
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
while
((
*
p
++
=
*
src
++
));
while
((
*
p
++
=
*
src
++
));
return
dst
;
return
dst
;
}
}
...
@@ -286,7 +300,14 @@ LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n )
...
@@ -286,7 +300,14 @@ LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n )
LPSTR
p
=
dst
;
LPSTR
p
=
dst
;
TRACE
(
string
,
"strcpyn %s for %d chars
\n
"
,
TRACE
(
string
,
"strcpyn %s for %d chars
\n
"
,
debugstr_an
(
src
,
n
),
n
);
debugstr_an
(
src
,
n
),
n
);
/* Windows does not check for NULL pointers here, so we don't either */
/* In real windows the whole function is protected by an exception handler
* that returns ERROR_INVALID_PARAMETER on faulty parameters
* We currently just check for NULL.
*/
if
(
!
dst
||
!
src
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
while
((
n
--
>
1
)
&&
*
src
)
*
p
++
=
*
src
++
;
while
((
n
--
>
1
)
&&
*
src
)
*
p
++
=
*
src
++
;
if
(
n
>=
0
)
*
p
=
0
;
if
(
n
>=
0
)
*
p
=
0
;
return
dst
;
return
dst
;
...
@@ -303,7 +324,14 @@ LPWSTR WINAPI lstrcpyn32W( LPWSTR dst, LPCWSTR src, INT32 n )
...
@@ -303,7 +324,14 @@ LPWSTR WINAPI lstrcpyn32W( LPWSTR dst, LPCWSTR src, INT32 n )
LPWSTR
p
=
dst
;
LPWSTR
p
=
dst
;
TRACE
(
string
,
"strcpyn L%s for %d chars
\n
"
,
TRACE
(
string
,
"strcpyn L%s for %d chars
\n
"
,
debugstr_wn
(
src
,
n
),
n
);
debugstr_wn
(
src
,
n
),
n
);
/* Windows does not check for NULL pointers here, so we don't either */
/* In real windows the whole function is protected by an exception handler
* that returns ERROR_INVALID_PARAMETER on faulty parameters
* We currently just check for NULL.
*/
if
(
!
dst
||
!
src
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
while
((
n
--
>
1
)
&&
*
src
)
*
p
++
=
*
src
++
;
while
((
n
--
>
1
)
&&
*
src
)
*
p
++
=
*
src
++
;
if
(
n
>=
0
)
*
p
=
0
;
if
(
n
>=
0
)
*
p
=
0
;
return
dst
;
return
dst
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment