diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index e0b1a5e5354..e11cf2c9e9b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -5512,12 +5512,19 @@ x_to_w32_font (lpxstr, lplogfont) | |||
| 5512 | 5512 | ||
| 5513 | if (fields > 0 && name[0] != '*') | 5513 | if (fields > 0 && name[0] != '*') |
| 5514 | { | 5514 | { |
| 5515 | int bufsize; | ||
| 5516 | unsigned char *buf; | ||
| 5517 | |||
| 5515 | setup_coding_system | 5518 | setup_coding_system |
| 5516 | (Fcheck_coding_system (Vw32_system_coding_system), &coding); | 5519 | (Fcheck_coding_system (Vw32_system_coding_system), &coding); |
| 5520 | bufsize = encoding_buffer_size (&coding, strlen (name)); | ||
| 5521 | buf = (unsigned char *) alloca (bufsize); | ||
| 5517 | coding.mode |= CODING_MODE_LAST_BLOCK; | 5522 | coding.mode |= CODING_MODE_LAST_BLOCK; |
| 5518 | encode_coding (&coding, name, lplogfont->lfFaceName, | 5523 | encode_coding (&coding, name, buf, strlen (name), bufsize); |
| 5519 | strlen (name), LF_FACESIZE-1); | 5524 | if (coding.produced >= LF_FACESIZE) |
| 5520 | lplogfont->lfFaceName[coding.produced] = 0; | 5525 | coding.produced = LF_FACESIZE - 1; |
| 5526 | buf[coding.produced] = 0; | ||
| 5527 | strcpy (lplogfont->lfFaceName, buf); | ||
| 5521 | } | 5528 | } |
| 5522 | else | 5529 | else |
| 5523 | { | 5530 | { |