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
3ef0b0ef
Commit
3ef0b0ef
authored
Nov 20, 2008
by
Francois Gouget
Committed by
Alexandre Julliard
Nov 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Pass the string length to REGPROC_export_string().
We already know it in the caller so this saves us one lstrlenW() call.
parent
d92c9768
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
regproc.c
programs/regedit/regproc.c
+6
-7
No files found.
programs/regedit/regproc.c
View file @
3ef0b0ef
...
...
@@ -890,22 +890,21 @@ static void REGPROC_resize_char_buffer(WCHAR **buffer, DWORD *len, DWORD require
/******************************************************************************
* Prints string str to file
*/
static
void
REGPROC_export_string
(
WCHAR
**
line_buf
,
DWORD
*
line_buf_size
,
DWORD
*
line_len
,
WCHAR
*
str
)
static
void
REGPROC_export_string
(
WCHAR
**
line_buf
,
DWORD
*
line_buf_size
,
DWORD
*
line_len
,
WCHAR
*
str
,
DWORD
str_len
)
{
DWORD
len
=
lstrlenW
(
str
);
DWORD
i
,
pos
;
DWORD
extra
=
0
;
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
10
);
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
str_
len
+
10
);
/* escaping characters */
pos
=
*
line_len
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
str_
len
;
i
++
)
{
WCHAR
c
=
str
[
i
];
switch
(
c
)
{
case
'\n'
:
extra
++
;
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
extra
);
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
str_
len
+
extra
);
(
*
line_buf
)[
pos
++
]
=
'\\'
;
(
*
line_buf
)[
pos
++
]
=
'n'
;
break
;
...
...
@@ -913,7 +912,7 @@ static void REGPROC_export_string(WCHAR **line_buf, DWORD *line_buf_size, DWORD
case
'\\'
:
case
'"'
:
extra
++
;
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
extra
);
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
str_
len
+
extra
);
(
*
line_buf
)[
pos
++
]
=
'\\'
;
/* Fall through */
...
...
@@ -1043,7 +1042,7 @@ static void export_hkey(FILE *file, HKEY key,
line_len
+=
len
;
if
(
val_size1
)
REGPROC_export_string
(
line_buf
,
line_buf_size
,
&
line_len
,
(
WCHAR
*
)
*
val_buf
);
REGPROC_export_string
(
line_buf
,
line_buf_size
,
&
line_len
,
(
WCHAR
*
)
*
val_buf
,
val_size1
/
sizeof
(
WCHAR
)
-
1
);
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
line_len
+
lstrlenW
(
end
));
lstrcpyW
(
*
line_buf
+
line_len
,
end
);
...
...
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