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
ecd35a02
Commit
ecd35a02
authored
Oct 31, 2006
by
Andrew Talbot
Committed by
Alexandre Julliard
Nov 01, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Cast-qual warnings fix.
parent
8125231e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
profile.c
dlls/kernel32/profile.c
+10
-14
No files found.
dlls/kernel32/profile.c
View file @
ecd35a02
...
...
@@ -1073,7 +1073,7 @@ static int PROFILE_GetPrivateProfileString( LPCWSTR section, LPCWSTR entry,
BOOL
win32
)
{
int
ret
;
LP
CWSTR
pDefVal
=
NULL
;
LP
WSTR
defval_tmp
=
NULL
;
TRACE
(
"%s,%s,%s,%p,%u,%s
\n
"
,
debugstr_w
(
section
),
debugstr_w
(
entry
),
debugstr_w
(
def_val
),
buffer
,
len
,
debugstr_w
(
filename
));
...
...
@@ -1092,16 +1092,13 @@ static int PROFILE_GetPrivateProfileString( LPCWSTR section, LPCWSTR entry,
if
(
*
p
==
' '
)
/* ouch, contained trailing ' ' */
{
int
len
=
(
int
)(
p
-
def_val
);
LPWSTR
p
;
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
p
,
def_val
,
len
*
sizeof
(
WCHAR
));
p
[
len
]
=
'\0'
;
pDefVal
=
p
;
}
defval_tm
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
defval_tm
p
,
def_val
,
len
*
sizeof
(
WCHAR
));
defval_tm
p
[
len
]
=
'\0'
;
def_val
=
defval_tm
p
;
}
}
if
(
!
pDefVal
)
pDefVal
=
def_val
;
RtlEnterCriticalSection
(
&
PROFILE_CritSect
);
...
...
@@ -1110,9 +1107,9 @@ static int PROFILE_GetPrivateProfileString( LPCWSTR section, LPCWSTR entry,
ret
=
PROFILE_GetSectionNames
(
buffer
,
len
);
else
/* PROFILE_GetString can handle the 'entry == NULL' case */
ret
=
PROFILE_GetString
(
section
,
entry
,
pDefV
al
,
buffer
,
len
,
win32
);
}
else
if
(
buffer
&&
pDefV
al
)
{
lstrcpynW
(
buffer
,
pDefV
al
,
len
);
ret
=
PROFILE_GetString
(
section
,
entry
,
def_v
al
,
buffer
,
len
,
win32
);
}
else
if
(
buffer
&&
def_v
al
)
{
lstrcpynW
(
buffer
,
def_v
al
,
len
);
ret
=
strlenW
(
buffer
);
}
else
...
...
@@ -1120,8 +1117,7 @@ static int PROFILE_GetPrivateProfileString( LPCWSTR section, LPCWSTR entry,
RtlLeaveCriticalSection
(
&
PROFILE_CritSect
);
if
(
pDefVal
!=
def_val
)
/* allocated */
HeapFree
(
GetProcessHeap
(),
0
,
(
void
*
)
pDefVal
);
HeapFree
(
GetProcessHeap
(),
0
,
defval_tmp
);
TRACE
(
"returning %s, %d
\n
"
,
debugstr_w
(
buffer
),
ret
);
...
...
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