emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100231: * editfns.c (Fbyte_to_str


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100231: * editfns.c (Fbyte_to_string): Signal an error if arg is not a byte.
Date: Sun, 21 Nov 2010 13:16:19 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100231
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Sun 2010-11-21 13:16:19 -0500
message:
  * editfns.c (Fbyte_to_string): Signal an error if arg is not a byte.
modified:
  src/ChangeLog
  src/editfns.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-11-20 13:50:55 +0000
+++ b/src/ChangeLog     2010-11-21 18:16:19 +0000
@@ -1,3 +1,7 @@
+2010-11-21  Chong Yidong  <address@hidden>
+
+       * editfns.c (Fbyte_to_string): Signal an error arg is not a byte.
+
 2010-11-20  Jan Djärv  <address@hidden>
 
        * gtkutil.c (menubar_map_cb): New function (Bug#7425).

=== modified file 'src/editfns.c'
--- a/src/editfns.c     2010-06-15 06:16:19 +0000
+++ b/src/editfns.c     2010-11-21 18:16:19 +0000
@@ -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);
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]