diff src/doc.c @ 209:41ff10fd062f r20-4b3

Import from CVS: tag r20-4b3
author cvs
date Mon, 13 Aug 2007 10:04:58 +0200
parents 489f57a838ef
children 78478c60bfcd
line wrap: on
line diff
--- a/src/doc.c	Mon Aug 13 10:03:54 2007 +0200
+++ b/src/doc.c	Mon Aug 13 10:04:58 2007 +0200
@@ -362,10 +362,13 @@
        (sym, prop, raw))
 {
   /* This function can GC */
-  REGISTER Lisp_Object doc;
+  REGISTER Lisp_Object doc = Qnil;
 #ifdef I18N3
   REGISTER Lisp_Object domain;
 #endif
+  struct gcpro gcpro1;
+
+  GCPRO1 (doc);
 
   doc = Fget (sym, prop, Qnil);
   if (INTP (doc))
@@ -384,6 +387,7 @@
 #endif
   if (NILP (raw) && STRINGP (doc))
     doc = Fsubstitute_command_keys (doc);
+  UNGCPRO;
   return doc;
 }
 
@@ -785,7 +789,7 @@
 #endif
 
   strlength = XSTRING_LENGTH (str);
-  bsize = strlength;
+  bsize = 1 + strlength;
   buf = (Bufbyte *) xmalloc (bsize);
   bufp = buf;