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
24195610
Commit
24195610
authored
Oct 09, 2006
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Oct 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: toolbar: Fix the TB_ADDSTRING from resources for a NUL delimiter.
parent
869c3bb7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
11 deletions
+7
-11
resources.h
dlls/comctl32/tests/resources.h
+0
-3
rsrc.rc
dlls/comctl32/tests/rsrc.rc
+0
-1
toolbar.c
dlls/comctl32/tests/toolbar.c
+0
-3
toolbar.c
dlls/comctl32/toolbar.c
+7
-4
No files found.
dlls/comctl32/tests/resources.h
View file @
24195610
...
...
@@ -29,9 +29,6 @@
#define IDS_TBADD3 18
#define IDS_TBADD4 19
#define IDS_TBADD5 20
#define IDS_TBADD6 21
#define IDS_TBADD7 22
#define IDS_TBADD8 23
#define IDS_TBADD9 24
#endif
/* __WINE_COMCTL32_TEST_RESOURCES_H */
dlls/comctl32/tests/rsrc.rc
View file @
24195610
...
...
@@ -37,7 +37,6 @@ STRINGTABLE
IDS_TBADD3 "*p*q*"
IDS_TBADD4 "#p#q##"
IDS_TBADD5 "|p||q|r|"
IDS_TBADD6 "\000a\000\000"
IDS_TBADD7 "abracadabra"
}
...
...
dlls/comctl32/tests/toolbar.c
View file @
24195610
...
...
@@ -362,9 +362,6 @@ void test_add_string()
ret
=
SendMessageA
(
hToolbar
,
TB_ADDSTRINGA
,
(
WPARAM
)
GetModuleHandle
(
NULL
),
IDS_TBADD5
);
ok
(
ret
==
8
,
"TB_ADDSTRINGA - unexpected return %d
\n
"
,
ret
);
CHECK_STRING_TABLE
(
11
,
ret6
);
ret
=
SendMessageA
(
hToolbar
,
TB_ADDSTRINGA
,
(
WPARAM
)
GetModuleHandle
(
NULL
),
IDS_TBADD6
);
ok
(
ret
==
11
,
"TB_ADDSTRINGA - unexpected return %d
\n
"
,
ret
);
CHECK_STRING_TABLE
(
11
,
ret6
);
ret
=
SendMessageA
(
hToolbar
,
TB_ADDSTRINGA
,
(
WPARAM
)
GetModuleHandle
(
NULL
),
IDS_TBADD7
);
ok
(
ret
==
11
,
"TB_ADDSTRINGA - unexpected return %d
\n
"
,
ret
);
CHECK_STRING_TABLE
(
14
,
ret7
);
...
...
dlls/comctl32/toolbar.c
View file @
24195610
...
...
@@ -2921,9 +2921,8 @@ TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT
len
;
TRACE
(
"adding string from resource!
\n
"
);
LoadStringW
((
HINSTANCE
)
wParam
,
(
UINT
)
lParam
,
len
=
LoadStringW
((
HINSTANCE
)
wParam
,
(
UINT
)
lParam
,
szString
,
MAX_RESOURCE_STRING_LENGTH
);
len
=
lstrlenW
(
szString
);
TRACE
(
"len=%d %s
\n
"
,
len
,
debugstr_w
(
szString
));
if
(
len
==
0
||
len
==
1
)
...
...
@@ -2932,11 +2931,15 @@ TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE
(
"Delimiter: 0x%x
\n
"
,
*
szString
);
delimiter
=
*
szString
;
p
=
szString
+
1
;
if
(
szString
[
len
-
1
]
==
delimiter
)
szString
[
len
-
1
]
=
0
;
while
((
next_delim
=
strchrW
(
p
,
delimiter
))
!=
NULL
)
{
*
next_delim
=
0
;
if
(
next_delim
+
1
>=
szString
+
len
)
{
/* this may happen if delimiter == '\0' or if the last char is a
* delimiter (then it is ignored like the native does) */
break
;
}
infoPtr
->
strings
=
ReAlloc
(
infoPtr
->
strings
,
sizeof
(
LPWSTR
)
*
(
infoPtr
->
nNumStrings
+
1
));
Str_SetPtrW
(
&
infoPtr
->
strings
[
infoPtr
->
nNumStrings
],
p
);
...
...
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