+2013-10-16 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * fns.c (Fstring_as_unibyte): Use xlispstrdup.
+
2013-10-15 Paul Eggert <eggert@cs.ucla.edu>
* print.c (print_object): Print " ..." when truncating bool vectors.
if (STRING_MULTIBYTE (string))
{
- ptrdiff_t bytes = SBYTES (string);
- unsigned char *str = xmalloc (bytes);
+ unsigned char *str = xlispstrdup (string);
+ ptrdiff_t bytes = str_as_unibyte (str, SBYTES (string));
- memcpy (str, SDATA (string), bytes);
- bytes = str_as_unibyte (str, bytes);
string = make_unibyte_string ((char *) str, bytes);
xfree (str);
}