summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-09-07 13:40:24 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-09-07 13:40:24 (GMT)
commitddb8c75c2fe1fdcf3a024bfdb129eb6d26ac3b24 (patch)
tree6e594e4c2852f63fdc8898f8603ce06190d93b80 /generic
parent31c2a87428c8648983c3500fc9dc48bfb99c873e (diff)
downloadtk-ddb8c75c2fe1fdcf3a024bfdb129eb6d26ac3b24.zip
tk-ddb8c75c2fe1fdcf3a024bfdb129eb6d26ac3b24.tar.gz
tk-ddb8c75c2fe1fdcf3a024bfdb129eb6d26ac3b24.tar.bz2
[Bug 3565533]: Purge use of variable that was only ever checked once immediately
afterwards, except for one (buggy) case where it was checked without assignment.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvPs.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index 6542864..0c7b0dd 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -170,7 +170,6 @@ TkCanvPostscriptCmd(
TkPostscriptInfo psInfo, *psInfoPtr = &psInfo;
Tk_PostscriptInfo oldInfoPtr;
int result;
- int written;
Tk_Item *itemPtr;
#define STRING_LENGTH 400
const char *p;
@@ -492,8 +491,7 @@ TkCanvPostscriptCmd(
Tcl_AppendObjToObj(psObj, preambleObj);
if (psInfo.chan != NULL) {
- written = Tcl_WriteObj(psInfo.chan, psObj);
- if (written == -1) {
+ if (Tcl_WriteObj(psInfo.chan, psObj) == -1) {
channelWriteFailed:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"problem writing postscript data to channel: %s",
@@ -547,8 +545,7 @@ TkCanvPostscriptCmd(
psInfo.x, Tk_PostscriptY((double)psInfo.y2,
(Tk_PostscriptInfo)psInfoPtr));
if (psInfo.chan != NULL) {
- written = Tcl_WriteObj(psInfo.chan, psObj);
- if (written == -1) {
+ if (Tcl_WriteObj(psInfo.chan, psObj) == -1) {
goto channelWriteFailed;
}
Tcl_DecrRefCount(psObj);
@@ -590,8 +587,7 @@ TkCanvPostscriptCmd(
Tcl_AppendToObj(psObj, "grestore\n", -1);
if (psInfo.chan != NULL) {
- written = Tcl_WriteObj(psInfo.chan, psObj);
- if (written == -1) {
+ if (Tcl_WriteObj(psInfo.chan, psObj) == -1) {
goto channelWriteFailed;
}
Tcl_DecrRefCount(psObj);
@@ -612,8 +608,7 @@ TkCanvPostscriptCmd(
"%%EOF\n", -1);
if (psInfo.chan != NULL) {
- Tcl_WriteObj(psInfo.chan, psObj);
- if (written == -1) {
+ if (Tcl_WriteObj(psInfo.chan, psObj) == -1) {
goto channelWriteFailed;
}
}