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
8e9e82f4
Commit
8e9e82f4
authored
Sep 08, 2012
by
Dan Kegel
Committed by
Alexandre Julliard
Sep 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp90: Handle npos as length in more places.
parent
5befb959
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
string.c
dlls/msvcp90/string.c
+6
-6
string.c
dlls/msvcp90/tests/string.c
+7
-1
No files found.
dlls/msvcp90/string.c
View file @
8e9e82f4
...
...
@@ -1331,7 +1331,7 @@ int __thiscall MSVCP_basic_string_char_compare_substr_cstr_len(
if
(
this
->
size
<
pos
)
MSVCP__String_base_Xran
();
if
(
pos
+
num
>
this
->
size
)
if
(
num
>
this
->
size
-
pos
)
num
=
this
->
size
-
pos
;
ans
=
MSVCP_char_traits_char_compare
(
basic_string_char_const_ptr
(
this
)
+
pos
,
...
...
@@ -1378,7 +1378,7 @@ int __thiscall MSVCP_basic_string_char_compare_substr_substr(
if
(
compare
->
size
<
off
)
MSVCP__String_base_Xran
();
if
(
off
+
count
>
compare
->
size
)
if
(
count
>
compare
->
size
-
off
)
count
=
compare
->
size
-
off
;
return
MSVCP_basic_string_char_compare_substr_cstr_len
(
this
,
pos
,
num
,
...
...
@@ -2017,7 +2017,7 @@ basic_string_char* __thiscall basic_string_char_replace_substr(basic_string_char
if
(
str
->
size
<
str_off
)
MSVCP__String_base_Xran
();
if
(
str_
off
+
str_len
>
str
->
size
)
if
(
str_
len
>
str
->
size
-
str_off
)
str_len
=
str
->
size
-
str_off
;
return
basic_string_char_replace_cstr_len
(
this
,
off
,
len
,
...
...
@@ -3265,7 +3265,7 @@ int __thiscall MSVCP_basic_string_wchar_compare_substr_cstr_len(
if
(
this
->
size
<
pos
)
MSVCP__String_base_Xran
();
if
(
pos
+
num
>
this
->
size
)
if
(
num
>
this
->
size
-
pos
)
num
=
this
->
size
-
pos
;
ans
=
MSVCP_char_traits_wchar_compare
(
basic_string_wchar_const_ptr
(
this
)
+
pos
,
...
...
@@ -3318,7 +3318,7 @@ int __thiscall MSVCP_basic_string_wchar_compare_substr_substr(
if
(
compare
->
size
<
off
)
MSVCP__String_base_Xran
();
if
(
off
+
count
>
compare
->
size
)
if
(
count
>
compare
->
size
-
off
)
count
=
compare
->
size
-
off
;
return
MSVCP_basic_string_wchar_compare_substr_cstr_len
(
this
,
pos
,
num
,
...
...
@@ -3980,7 +3980,7 @@ basic_string_wchar* __thiscall basic_string_wchar_replace_substr(basic_string_wc
if
(
str
->
size
<
str_off
)
MSVCP__String_base_Xran
();
if
(
str_
off
+
str_len
>
str
->
size
)
if
(
str_
len
>
str
->
size
-
str_off
)
str_len
=
str
->
size
-
str_off
;
return
basic_string_wchar_replace_cstr_len
(
this
,
off
,
len
,
...
...
dlls/msvcp90/tests/string.c
View file @
8e9e82f4
...
...
@@ -17,6 +17,7 @@
*/
#include <stdio.h>
#include <limits.h>
#include <windef.h>
#include <winbase.h>
...
...
@@ -450,11 +451,12 @@ static void test_basic_string_char_append(void) {
}
static
void
test_basic_string_char_compare
(
void
)
{
basic_string_char
str1
,
str2
;
basic_string_char
str1
,
str2
,
str3
;
int
ret
;
call_func2
(
p_basic_string_char_ctor_cstr
,
&
str1
,
"str1str"
);
call_func2
(
p_basic_string_char_ctor_cstr
,
&
str2
,
"str9str"
);
call_func2
(
p_basic_string_char_ctor_cstr
,
&
str3
,
"splash.png"
);
ret
=
(
int
)
call_func6
(
p_basic_string_char_compare_substr_substr
,
&
str1
,
0
,
3
,
&
str2
,
0
,
3
);
...
...
@@ -470,6 +472,9 @@ static void test_basic_string_char_compare(void) {
&
str1
,
0
,
1000
,
"str1str"
,
7
);
ok
(
ret
==
0
,
"ret = %d
\n
"
,
ret
);
ret
=
(
int
)
call_func5
(
p_basic_string_char_compare_substr_cstr_len
,
&
str3
,
6
,
UINT_MAX
,
".png"
,
4
);
ok
(
ret
==
0
,
"ret = %d
\n
"
,
ret
);
ret
=
(
int
)
call_func5
(
p_basic_string_char_compare_substr_cstr_len
,
&
str1
,
1
,
2
,
"tr"
,
2
);
ok
(
ret
==
0
,
"ret = %d
\n
"
,
ret
);
ret
=
(
int
)
call_func5
(
p_basic_string_char_compare_substr_cstr_len
,
...
...
@@ -481,6 +486,7 @@ static void test_basic_string_char_compare(void) {
call_func1
(
p_basic_string_char_dtor
,
&
str1
);
call_func1
(
p_basic_string_char_dtor
,
&
str2
);
call_func1
(
p_basic_string_char_dtor
,
&
str3
);
}
static
void
test_basic_string_char_concatenate
(
void
)
{
...
...
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