diff options
Diffstat (limited to 'src/editfns.c')
-rw-r--r-- | src/editfns.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c index f76beb5e678..4a9e2314a84 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -218,11 +218,13 @@ 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. */) (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); } |