# HG changeset patch # User Chong Yidong # Date 1290363379 18000 # Node ID 0e4f6aed76c8ca63de805a394448ff4e400ddd39 # Parent 350f17da7963ca1e8b894f6bb9f6c3d854dde227 * editfns.c (Fbyte_to_string): Signal an error if arg is not a byte. diff -r 350f17da7963 -r 0e4f6aed76c8 src/ChangeLog --- a/src/ChangeLog Sun Nov 21 13:07:47 2010 -0500 +++ b/src/ChangeLog Sun Nov 21 13:16:19 2010 -0500 @@ -1,3 +1,7 @@ +2010-11-21 Chong Yidong + + * editfns.c (Fbyte_to_string): Signal an error arg is not a byte. + 2010-11-20 Jan Djärv * gtkutil.c (menubar_map_cb): New function (Bug#7425). diff -r 350f17da7963 -r 0e4f6aed76c8 src/editfns.c --- a/src/editfns.c Sun Nov 21 13:07:47 2010 -0500 +++ b/src/editfns.c Sun Nov 21 13:16:19 2010 -0500 @@ -222,12 +222,14 @@ } DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0, - doc: /* Convert arg BYTE to a string containing that byte. */) + doc: /* Convert arg BYTE to a unibyte string containing that byte. */) (byte) Lisp_Object byte; { unsigned char b; CHECK_NUMBER (byte); + if (XINT (byte) < 0 || XINT (byte) > 255) + error ("Invalid byte"); b = XINT (byte); return make_string_from_bytes (&b, 1, 1); }