[Patch] fhandler.cc: debug_printf when copied_chars is zero.

Bas van Gompel cygwin-patches.buzz@bavag.tmfweb.nl
Sat Dec 4 23:01:00 GMT 2004


Hi,

While going over a strace I noticed some garbage in the (debug) output
when fhandler_base::read had read zero bytes. Following (trivial)
patch fixes that.


ChangeLog-entry:

2004-12-05  Bas van Gompel  <cygwin-patch.buzz@bavag.tmfweb.nl>

	* fhandler.cc (fhandler_base::read): Don't debug_printf garbage when
	copied_chars is zero.


--- src/winsup/cygwin/fhandler.cc	20 Nov 2004 23:42:36 -0000	1.207
+++ src/winsup/cygwin/fhandler.cc	4 Dec 2004 22:04:38 -0000
@@ -758,6 +758,7 @@ fhandler_base::read (void *in_ptr, size_
 	  __small_sprintf (p, c >= 33 && c <= 127 ? " %c" : " %p", c);
 	  p += strlen (p);
 	}
+      *p = '\0';
       debug_printf ("read %d bytes (%s%s)", copied_chars, buf,
 		    copied_chars > 16 ? " ..." : "");
     }


L8r,

Buzz.

BTW: In how-vfork-works.txt, lines 31 and 32 end in CRLF.
BTW2: ansi.sgml has no linefeed at the end of the file.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   /    /   really is |   and false bits entirely.    | mail for
  ) |  |  /    /    a 72 by 4 +-------------------------------+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe "s.u(z)\1.as."    | me. 4^re



More information about the Cygwin-patches mailing list