summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-07-05 13:56:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-07-05 13:56:00 (GMT)
commita54ec2aacbcefc9937f752af4178841cc53e9d25 (patch)
tree0367da0ef2ac5fe159aea82f6775995b75c7a54d /win
parent36245ad98788adfc0a8906fdd9c61ac0b82990b4 (diff)
parent8c652eebaacd8ebb77c256428a3cda8a1bf8b814 (diff)
downloadtcl-a54ec2aacbcefc9937f752af4178841cc53e9d25.zip
tcl-a54ec2aacbcefc9937f752af4178841cc53e9d25.tar.gz
tcl-a54ec2aacbcefc9937f752af4178841cc53e9d25.tar.bz2
1189293 Make "<<" binary safe.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinPipe.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 65d4d06..cc696a2 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -676,6 +676,7 @@ TclpCreateTempFile(
if (contents != NULL) {
DWORD result, length;
const char *p;
+ int toCopy;
/*
* Convert the contents from UTF to native encoding
@@ -683,7 +684,8 @@ TclpCreateTempFile(
native = Tcl_UtfToExternalDString(NULL, contents, -1, &dstring);
- for (p = native; *p != '\0'; p++) {
+ toCopy = Tcl_DStringLength(&dstring);
+ for (p = native; toCopy > 0; p++, toCopy--) {
if (*p == '\n') {
length = p - native;
if (length > 0) {