Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
520f41b2
Commit
520f41b2
authored
Aug 11, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Don't write null byte in IPersist*::Save functions.
parent
0d589954
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
persist.c
dlls/mshtml/persist.c
+8
-10
No files found.
dlls/mshtml/persist.c
View file @
520f41b2
...
...
@@ -337,7 +337,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
return
S_OK
;
}
static
HRESULT
get_doc_string
(
HTMLDocument
*
This
,
char
**
str
,
DWORD
*
len
)
static
HRESULT
get_doc_string
(
HTMLDocument
*
This
,
char
**
str
)
{
nsIDOMNode
*
nsnode
;
LPCWSTR
strw
;
...
...
@@ -362,9 +362,7 @@ static HRESULT get_doc_string(HTMLDocument *This, char **str, DWORD *len)
nsAString_GetData
(
&
nsstr
,
&
strw
);
TRACE
(
"%s
\n
"
,
debugstr_w
(
strw
));
*
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
strw
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
*
str
=
heap_alloc
(
*
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
strw
,
-
1
,
*
str
,
*
len
,
NULL
,
NULL
);
*
str
=
heap_strdupWtoA
(
strw
);
nsAString_Finish
(
&
nsstr
);
...
...
@@ -583,7 +581,7 @@ static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileNam
{
HTMLDocument
*
This
=
PERSISTFILE_THIS
(
iface
);
char
*
str
;
DWORD
len
,
written
=
0
;
DWORD
written
=
0
;
HANDLE
file
;
HRESULT
hres
;
...
...
@@ -596,9 +594,9 @@ static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileNam
return
E_FAIL
;
}
hres
=
get_doc_string
(
This
,
&
str
,
&
len
);
hres
=
get_doc_string
(
This
,
&
str
);
if
(
SUCCEEDED
(
hres
))
WriteFile
(
file
,
str
,
len
,
&
written
,
NULL
);
WriteFile
(
file
,
str
,
strlen
(
str
)
,
&
written
,
NULL
);
CloseHandle
(
file
);
return
hres
;
...
...
@@ -698,16 +696,16 @@ static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM
{
HTMLDocument
*
This
=
PERSTRINIT_THIS
(
iface
);
char
*
str
;
DWORD
len
,
written
=
0
;
DWORD
written
=
0
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p %x)
\n
"
,
This
,
pStm
,
fClearDirty
);
hres
=
get_doc_string
(
This
,
&
str
,
&
len
);
hres
=
get_doc_string
(
This
,
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
IStream_Write
(
pStm
,
str
,
len
,
&
written
);
hres
=
IStream_Write
(
pStm
,
str
,
strlen
(
str
)
,
&
written
);
if
(
FAILED
(
hres
))
FIXME
(
"Write failed: %08x
\n
"
,
hres
);
...
...
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