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
c2df317c
Commit
c2df317c
authored
May 14, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
May 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix LoadStringA behavior on 1-character long buffer.
parent
54481679
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
resource.c
dlls/user32/resource.c
+2
-1
resource.c
dlls/user32/tests/resource.c
+7
-0
No files found.
dlls/user32/resource.c
View file @
c2df317c
...
...
@@ -310,7 +310,8 @@ INT WINAPI LoadStringA( HINSTANCE instance, UINT resource_id, LPSTR buffer, INT
while
(
id
--
)
p
+=
*
p
+
1
;
RtlUnicodeToMultiByteN
(
buffer
,
buflen
-
1
,
&
retval
,
p
+
1
,
*
p
*
sizeof
(
WCHAR
)
);
if
(
buflen
!=
1
)
RtlUnicodeToMultiByteN
(
buffer
,
buflen
-
1
,
&
retval
,
p
+
1
,
*
p
*
sizeof
(
WCHAR
)
);
}
buffer
[
retval
]
=
0
;
TRACE
(
"returning %s
\n
"
,
debugstr_a
(
buffer
));
...
...
dlls/user32/tests/resource.c
View file @
c2df317c
...
...
@@ -126,6 +126,13 @@ static void test_LoadStringA (void)
ok
(
ret
==
-
1
||
broken
(
ret
==
0
),
"LoadStringA did not return -1 when called with buflen = 0, got %d, err %d
\n
"
,
ret
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
buf
[
0
]
=
'a'
;
ret
=
LoadStringA
(
hInst
,
1
,
buf
,
1
);
ok
(
!
ret
,
"LoadString returned %d
\n
"
,
ret
);
ok
(
buf
[
0
]
==
0
,
"buf[0] = %c (%x)
\n
"
,
buf
[
0
],
buf
[
0
]);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GetLastError() = %d
\n
"
,
GetLastError
());
}
static
void
test_accel1
(
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