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
361adc80
Commit
361adc80
authored
Mar 24, 2000
by
Huw D M Davies
Committed by
Alexandre Julliard
Mar 24, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that non-NULL terminated stings are saved correctly.
parent
c18f6294
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
registry.c
server/registry.c
+5
-5
No files found.
server/registry.c
View file @
361adc80
...
...
@@ -1285,10 +1285,10 @@ static int update_level( struct key *key )
}
/* dump a string to a registry save file in the old v1 format */
static
void
save_string_v1
(
LPCWSTR
str
,
FILE
*
f
)
static
void
save_string_v1
(
LPCWSTR
str
,
FILE
*
f
,
int
len
)
{
if
(
!
str
)
return
;
while
(
*
str
)
while
(
(
len
==
-
1
)
?
*
str
:
(
*
str
&&
len
--
)
)
{
if
((
*
str
>
0x7f
)
||
(
*
str
==
'\n'
)
||
(
*
str
==
'='
))
fprintf
(
f
,
"
\\
u%04x"
,
*
str
);
...
...
@@ -1312,10 +1312,10 @@ static void save_subkeys_v1( struct key *key, int nesting, FILE *f )
{
struct
key_value
*
value
=
&
key
->
values
[
i
];
for
(
j
=
nesting
;
j
>
0
;
j
--
)
fputc
(
'\t'
,
f
);
save_string_v1
(
value
->
name
,
f
);
save_string_v1
(
value
->
name
,
f
,
-
1
);
fprintf
(
f
,
"=%d,%d,"
,
value
->
type
,
0
);
if
(
value
->
type
==
REG_SZ
||
value
->
type
==
REG_EXPAND_SZ
)
save_string_v1
(
(
LPWSTR
)
value
->
data
,
f
);
save_string_v1
(
(
LPWSTR
)
value
->
data
,
f
,
value
->
len
/
2
);
else
for
(
j
=
0
;
j
<
value
->
len
;
j
++
)
fprintf
(
f
,
"%02x"
,
*
((
unsigned
char
*
)
value
->
data
+
j
)
);
...
...
@@ -1324,7 +1324,7 @@ static void save_subkeys_v1( struct key *key, int nesting, FILE *f )
for
(
i
=
0
;
i
<=
key
->
last_subkey
;
i
++
)
{
for
(
j
=
nesting
;
j
>
0
;
j
--
)
fputc
(
'\t'
,
f
);
save_string_v1
(
key
->
subkeys
[
i
]
->
name
,
f
);
save_string_v1
(
key
->
subkeys
[
i
]
->
name
,
f
,
-
1
);
fputc
(
'\n'
,
f
);
save_subkeys_v1
(
key
->
subkeys
[
i
],
nesting
+
1
,
f
);
}
...
...
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