HCoop
/
bpt
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e238283
)
(x_to_w32_font): Provide sufficient buffer to encode_coding to avoid carryover.
author
Richard M. Stallman
<rms@gnu.org>
Wed, 7 Apr 1999 05:48:00 +0000
(
05:48
+0000)
committer
Richard M. Stallman
<rms@gnu.org>
Wed, 7 Apr 1999 05:48:00 +0000
(
05:48
+0000)
src/w32fns.c
patch
|
blob
|
blame
|
history
diff --git
a/src/w32fns.c
b/src/w32fns.c
index
e0b1a5e
..
e11cf2c
100644
(file)
--- a/
src/w32fns.c
+++ b/
src/w32fns.c
@@
-5512,12
+5512,19
@@
x_to_w32_font (lpxstr, lplogfont)
if (fields > 0 && name[0] != '*')
{
if (fields > 0 && name[0] != '*')
{
+ int bufsize;
+ unsigned char *buf;
+
setup_coding_system
(Fcheck_coding_system (Vw32_system_coding_system), &coding);
setup_coding_system
(Fcheck_coding_system (Vw32_system_coding_system), &coding);
+ bufsize = encoding_buffer_size (&coding, strlen (name));
+ buf = (unsigned char *) alloca (bufsize);
coding.mode |= CODING_MODE_LAST_BLOCK;
coding.mode |= CODING_MODE_LAST_BLOCK;
- encode_coding (&coding, name, lplogfont->lfFaceName,
- strlen (name), LF_FACESIZE-1);
- lplogfont->lfFaceName[coding.produced] = 0;
+ encode_coding (&coding, name, buf, strlen (name), bufsize);
+ if (coding.produced >= LF_FACESIZE)
+ coding.produced = LF_FACESIZE - 1;
+ buf[coding.produced] = 0;
+ strcpy (lplogfont->lfFaceName, buf);
}
else
{
}
else
{