Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
632ac0b2
Commit
632ac0b2
authored
Dec 16, 2011
by
Francois Gouget
Committed by
Alexandre Julliard
Dec 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Avoid hardcoding the Unicode string literal lengths.
parent
95577f33
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
console.c
dlls/kernel32/console.c
+1
-2
atom.c
dlls/kernel32/tests/atom.c
+4
-4
codepage.c
dlls/kernel32/tests/codepage.c
+2
-2
No files found.
dlls/kernel32/console.c
View file @
632ac0b2
...
...
@@ -2430,8 +2430,7 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber
break
;
case
'\t'
:
{
WCHAR
tmp
[
8
]
=
{
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
};
static
const
WCHAR
tmp
[]
=
{
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
,
' '
};
if
(
!
write_block
(
hConsoleOutput
,
&
csbi
,
mode
,
tmp
,
((
csbi
.
dwCursorPosition
.
X
+
8
)
&
~
7
)
-
csbi
.
dwCursorPosition
.
X
))
goto
the_end
;
...
...
dlls/kernel32/tests/atom.c
View file @
632ac0b2
...
...
@@ -168,11 +168,11 @@ static void test_get_atom_name(void)
if
(
unicode_OS
)
{
static
const
WCHAR
sampleW
[
10
]
=
{
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
};
static
const
WCHAR
sampleW
[]
=
{
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
};
for
(
i
=
0
;
i
<
10
;
i
++
)
bufW
[
i
]
=
'.'
;
ok
(
!
GlobalGetAtomNameW
(
atom
,
bufW
,
0
),
"succeeded
\n
"
);
ok
(
!
memcmp
(
bufW
,
sampleW
,
10
*
sizeof
(
WCHAR
)
),
"should not touch buffer
\n
"
);
ok
(
!
memcmp
(
bufW
,
sampleW
,
sizeof
(
sampleW
)
),
"should not touch buffer
\n
"
);
}
/* Test integer atoms */
...
...
@@ -442,11 +442,11 @@ static void test_local_get_atom_name(void)
if
(
unicode_OS
)
{
static
const
WCHAR
sampleW
[
10
]
=
{
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
};
static
const
WCHAR
sampleW
[]
=
{
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
};
for
(
i
=
0
;
i
<
10
;
i
++
)
bufW
[
i
]
=
'.'
;
ok
(
!
GetAtomNameW
(
atom
,
bufW
,
0
),
"succeeded
\n
"
);
ok
(
!
memcmp
(
bufW
,
sampleW
,
10
*
sizeof
(
WCHAR
)
),
"should not touch buffer
\n
"
);
ok
(
!
memcmp
(
bufW
,
sampleW
,
sizeof
(
sampleW
)
),
"should not touch buffer
\n
"
);
}
/* Test integer atoms */
...
...
dlls/kernel32/tests/codepage.c
View file @
632ac0b2
...
...
@@ -211,8 +211,8 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar)
int
ret
;
WCHAR
wc1
=
228
;
/* Western Windows-1252 character */
WCHAR
wc2
=
1088
;
/* Russian Windows-1251 character not displayable for Windows-1252 */
WCHAR
wcs
[
5
]
=
{
'T'
,
'h'
,
1088
,
'i'
,
0
};
/* String with ASCII characters and a Russian character */
WCHAR
dbwcs
[
3
]
=
{
28953
,
25152
,
0
};
/* String with Chinese (codepage 950) characters */
static
const
WCHAR
wcs
[]
=
{
'T'
,
'h'
,
1088
,
'i'
,
0
};
/* String with ASCII characters and a Russian character */
static
const
WCHAR
dbwcs
[]
=
{
28953
,
25152
,
0
};
/* String with Chinese (codepage 950) characters */
SetLastError
(
0xdeadbeef
);
ret
=
WideCharToMultiByte
(
1252
,
0
,
&
wc1
,
1
,
&
mbc
,
1
,
NULL
,
bUsedDefaultChar
);
...
...
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