changeset 6695:c66bed2f25af

(describe_buffer_bindings): Move XSYMBOL to after SYMBOLP. Exclude trailing null in string copies.
author Karl Heuer <kwzh@gnu.org>
date Wed, 06 Apr 1994 02:07:40 +0000
parents 3ba55de6f14f
children 097fa44199ab
files src/keymap.c
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/keymap.c	Wed Apr 06 00:51:43 1994 +0000
+++ b/src/keymap.c	Wed Apr 06 02:07:40 1994 +0000
@@ -1807,15 +1807,15 @@
     /* Print the minor mode maps.  */
     for (i = 0; i < nmaps; i++)
       {
-	/* Tht title for a minor mode keymap
+	/* The title for a minor mode keymap
 	   is constructed at run time.
 	   We let describe_map_tree do the actual insertion
 	   because it takes care of other features when doing so.  */
-	char *title = (char *) alloca (40 + XSYMBOL (modes[i])->name->size);
-	char *p = title;
+	char *title, *p;
 
 	if (XTYPE (modes[i]) == Lisp_Symbol)
 	  {
+	    p = title = (char *) alloca (40 + XSYMBOL (modes[i])->name->size);
 	    *p++ = '`';
 	    bcopy (XSYMBOL (modes[i])->name->data, p,
 		   XSYMBOL (modes[i])->name->size);
@@ -1824,11 +1824,12 @@
 	  }
 	else
 	  {
-	    bcopy ("Strangely Named", p, sizeof ("Strangely Named"));
-	    p += sizeof ("Strangely Named");
+	    p = title = (char *) alloca (40 + 20);
+	    bcopy ("Strangely Named", p, sizeof ("Strangely Named") - 1);
+	    p += sizeof ("Strangely Named") - 1;
 	  }
-	bcopy (" Minor Mode Bindings", p, sizeof (" Minor Mode Bindings"));
-	p += sizeof (" Minor Mode Bindings");
+	bcopy (" Minor Mode Bindings", p, sizeof (" Minor Mode Bindings") - 1);
+	p += sizeof (" Minor Mode Bindings") - 1;
 	*p = 0;
 
 	describe_map_tree (maps[i], 0, shadow, prefix, title, 0);