]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix minor bugs with printing null bytes
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 20 Jan 2015 04:28:51 +0000 (20:28 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 20 Jan 2015 04:29:26 +0000 (20:29 -0800)
* minibuf.c (read_minibuf_noninteractive):
* xdisp.c (Ftrace_to_stderr) [GLYPH_DEBUG]:
Work even if the Lisp string contains a null byte.

src/ChangeLog
src/minibuf.c
src/xdisp.c

index b77f00c21c55b041ce735e4d045daaf967d39e96..ad7780fbca7d222a36ccf9a11151463bcd29c57b 100644 (file)
@@ -1,5 +1,10 @@
 2015-01-20  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Fix minor bugs with printing null bytes
+       * minibuf.c (read_minibuf_noninteractive):
+       * xdisp.c (Ftrace_to_stderr) [GLYPH_DEBUG]:
+       Work even if the Lisp string contains a null byte.
+
        Port to hypothetical case where Qnil is nonzero
        * alloc.c (allocate_pseudovector):
        * callint.c (Fcall_interactively):
index 07f489258e14769638773fbb4dd6f149735ae2f1..0d6e2c798137106d463fc4d97816a46d15259236 100644 (file)
@@ -217,7 +217,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
       suppress_echo_on_tty (fileno (stdin));
     }
 
-  fprintf (stdout, "%s", SDATA (prompt));
+  fwrite (SDATA (prompt), 1, SBYTES (prompt), stdout);
   fflush (stdout);
 
   val = Qnil;
index 8d53274fd7ba9ceb4e0ecbddddb7266666a45775..9abaeb0d77718c3249a3a56c69eeea73040d8d23 100644 (file)
@@ -18815,7 +18815,7 @@ usage: (trace-to-stderr STRING &rest OBJECTS)  */)
   (ptrdiff_t nargs, Lisp_Object *args)
 {
   Lisp_Object s = Fformat (nargs, args);
-  fprintf (stderr, "%s", SDATA (s));
+  fwrite (SDATA (s), 1, SBYTES (s), stderr);
   return Qnil;
 }