Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-10-22 23:39:31 +0300
committerCorinna Vinschen <corinna@vinschen.de>2016-10-22 23:39:31 +0300
commit61401f24ef91b8b4321fd250c5942e9ec6ed3076 (patch)
tree9eedfb743a530bda291928901a3a3ffed195c616 /winsup/utils/strace.cc
parent46c472a1c15a61af1db656f6b55af9b4e5e450d6 (diff)
strace: Add comment trying to explain confusing code
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/utils/strace.cc')
-rw-r--r--winsup/utils/strace.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index 5d4a23d0f..eb96a61b6 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -472,6 +472,12 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile)
len = 17;
}
+ /* Note that the following code deliberately points buf 20 bytes into the
+ allocated area. The subsequent code then overwrites the usecs value
+ given in the application's debug string, which potentially prepends
+ characters to the string. If that sounds confusing and dangerous, well...
+
+ TODO: This needs a cleanup. */
char *buf;
buf = (char *) alloca (len + 85) + 20;