diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2010-11-21 13:16:19 -0500 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-11-21 13:16:19 -0500 |
commit | b170be10090d4f27082934029da36141b3a2f2ef (patch) | |
tree | 326252effbed8b4b3b0443a22916af46fd66aa23 /src | |
parent | a306488fc43b9527b108cd0c45719aa9725bbad9 (diff) | |
download | emacs-b170be10090d4f27082934029da36141b3a2f2ef.tar.gz |
* editfns.c (Fbyte_to_string): Signal an error if arg is not a byte.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/editfns.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5c42a177516..e61e3ef0607 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-11-21 Chong Yidong <cyd@stupidchicken.com> + + * editfns.c (Fbyte_to_string): Signal an error arg is not a byte. + 2010-11-20 Jan Djärv <jan.h.d@swipnet.se> * 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); } |