src/w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
last argument of make_unibyte_string.
2012-06-23 Eli Zaretskii <eliz@gnu.org>
+ * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
+ last argument of make_unibyte_string.
+
* keyboard.c (kbd_buffer_get_event): Include the codepage and the
language ID in the event parameters.
got_full = GetLocaleInfo (XINT (lcid),
XINT (longform),
full_name, sizeof (full_name));
+ /* GetLocaleInfo's return value includes the terminating null
+ character, when the returned information is a string, whereas
+ make_unibyte_string needs the string length without the
+ terminating null. */
if (got_full)
- return make_unibyte_string (full_name, got_full);
+ return make_unibyte_string (full_name, got_full - 1);
}
return Qnil;