From: Chong Yidong Date: Sun, 21 Nov 2010 18:16:19 +0000 (-0500) Subject: * editfns.c (Fbyte_to_string): Signal an error if arg is not a byte. X-Git-Tag: emacs-pretest-23.2.91~49^2~10 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=35f1de62f2ab87e39c4a058cb34668727e9a9c42;p=emacs.git * editfns.c (Fbyte_to_string): Signal an error if arg is not a byte. --- diff --git a/src/ChangeLog b/src/ChangeLog index 4655ea714ad..f986c03cc14 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 --git a/src/editfns.c b/src/editfns.c index ea279a462f2..910fd13aed4 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -222,12 +222,14 @@ usage: (char-to-string CHAR) */) } 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); }