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
f53f40bc
Commit
f53f40bc
authored
Feb 07, 2009
by
Dylan Smith
Committed by
Alexandre Julliard
Feb 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Prevent string trunction due to NULL characters.
parent
1ceb903f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
20 deletions
+9
-20
editor.h
dlls/riched20/editor.h
+0
-1
string.c
dlls/riched20/string.c
+9
-19
No files found.
dlls/riched20/editor.h
View file @
f53f40bc
...
...
@@ -95,7 +95,6 @@ ME_String *ME_MakeStringB(int nMaxChars);
ME_String
*
ME_StrDup
(
const
ME_String
*
s
);
void
ME_DestroyString
(
ME_String
*
s
);
void
ME_AppendString
(
ME_String
*
s1
,
const
ME_String
*
s2
);
ME_String
*
ME_ConcatString
(
const
ME_String
*
s1
,
const
ME_String
*
s2
);
ME_String
*
ME_VSplitString
(
ME_String
*
orig
,
int
nVPos
);
int
ME_IsWhitespaces
(
const
ME_String
*
s
);
int
ME_IsSplitable
(
const
ME_String
*
s
);
...
...
dlls/riched20/string.c
View file @
f53f40bc
...
...
@@ -90,35 +90,25 @@ void ME_DestroyString(ME_String *s)
void
ME_AppendString
(
ME_String
*
s1
,
const
ME_String
*
s2
)
{
if
(
s1
->
nLen
+
s2
->
nLen
+
1
<=
s1
->
nBuffer
)
{
lstrcpyW
(
s1
->
szData
+
s1
->
nLen
,
s2
->
szData
);
s1
->
nLen
+=
s2
->
nLen
;
}
else
if
(
s1
->
nLen
+
s2
->
nLen
+
1
<=
s1
->
nBuffer
)
{
memcpy
(
s1
->
szData
+
s1
->
nLen
,
s2
->
szData
,
s2
->
nLen
*
sizeof
(
WCHAR
));
s1
->
nLen
+=
s2
->
nLen
;
s1
->
szData
[
s1
->
nLen
]
=
0
;
}
else
{
WCHAR
*
buf
;
s1
->
nBuffer
=
ME_GetOptimalBuffer
(
s1
->
nLen
+
s2
->
nLen
+
1
);
buf
=
ALLOC_N_OBJ
(
WCHAR
,
s1
->
nBuffer
);
lstrcpyW
(
buf
,
s1
->
szData
);
lstrcpyW
(
buf
+
s1
->
nLen
,
s2
->
szData
);
buf
=
ALLOC_N_OBJ
(
WCHAR
,
s1
->
nBuffer
);
memcpy
(
buf
,
s1
->
szData
,
s1
->
nLen
*
sizeof
(
WCHAR
)
);
memcpy
(
buf
+
s1
->
nLen
,
s2
->
szData
,
s2
->
nLen
*
sizeof
(
WCHAR
)
);
FREE_OBJ
(
s1
->
szData
);
s1
->
szData
=
buf
;
s1
->
nLen
+=
s2
->
nLen
;
s1
->
szData
[
s1
->
nLen
]
=
0
;
}
}
ME_String
*
ME_ConcatString
(
const
ME_String
*
s1
,
const
ME_String
*
s2
)
{
ME_String
*
s
=
ALLOC_OBJ
(
ME_String
);
s
->
nLen
=
s1
->
nLen
+
s2
->
nLen
;
s
->
nBuffer
=
ME_GetOptimalBuffer
(
s1
->
nLen
+
s2
->
nLen
+
1
);
s
->
szData
=
ALLOC_N_OBJ
(
WCHAR
,
s
->
nBuffer
);
lstrcpyW
(
s
->
szData
,
s1
->
szData
);
lstrcpyW
(
s
->
szData
+
s1
->
nLen
,
s2
->
szData
);
return
s
;
}
ME_String
*
ME_VSplitString
(
ME_String
*
orig
,
int
charidx
)
{
ME_String
*
s
;
...
...
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