This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
[Patch] fhandler.cc: debug_printf when copied_chars is zero.
- From: Bas van Gompel <cygwin-patches dot buzz at bavag dot tmfweb dot nl>
- To: cygwin-patches at cygwin dot com
- Date: Sun, 5 Dec 2004 00:01:02 +0100 (MET)
- Subject: [Patch] fhandler.cc: debug_printf when copied_chars is zero.
- Organisation: Ehm...
- Reply-to: cygwin-patches mailing-list <cygwin-patches at cygwin dot com>
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