diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-03 14:52:55 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-03 14:52:55 (GMT) |
commit | 08bec1c1e8e4aae5cb45d4c68a2ab5d9bd73470e (patch) | |
tree | 84118ecaa9257d1f2e99228c0ae52bc98d574b97 /win/tclWinSock.c | |
parent | a70bdc9ec1f2e2009feff998bb7ceb63dd28cb90 (diff) | |
download | tcl-08bec1c1e8e4aae5cb45d4c68a2ab5d9bd73470e.zip tcl-08bec1c1e8e4aae5cb45d4c68a2ab5d9bd73470e.tar.gz tcl-08bec1c1e8e4aae5cb45d4c68a2ab5d9bd73470e.tar.bz2 |
Factor out a number of common patterns of use of Tcl_DStringAppend.
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r-- | win/tclWinSock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 166fdfd..ca49d22 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -2590,11 +2590,11 @@ InitializeHostName( Tcl_DStringInit(&inDs); Tcl_DStringSetLength(&inDs, 255); if (gethostname(Tcl_DStringValue(&inDs), - Tcl_DStringLength(&inDs)) == 0) { - Tcl_DStringSetLength(&ds, 0); + Tcl_DStringLength(&inDs)) == 0) { + TclDStringClear(&ds); } else { - Tcl_ExternalToUtfDString(NULL, - Tcl_DStringValue(&inDs), -1, &ds); + Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&inDs), -1, + &ds); } Tcl_DStringFree(&inDs); } |