diff options
author | joye <joye> | 2014-06-03 19:52:04 (GMT) |
---|---|---|
committer | joye <joye> | 2014-06-03 19:52:04 (GMT) |
commit | a8c6c26f42fc68dbd39a476930be0f1e0e86fb5b (patch) | |
tree | fbd018c5e31574a75c854c0849f57c053386d59e | |
parent | f4ac6f02009ef7f85d6e00d43b76bb0c39af4bf9 (diff) | |
download | blt-a8c6c26f42fc68dbd39a476930be0f1e0e86fb5b.zip blt-a8c6c26f42fc68dbd39a476930be0f1e0e86fb5b.tar.gz blt-a8c6c26f42fc68dbd39a476930be0f1e0e86fb5b.tar.bz2 |
*** empty log message ***
-rw-r--r-- | src/bltConfig.C | 8 | ||||
-rw-r--r-- | src/bltGrPSOutput.C | 9 | ||||
-rw-r--r-- | src/bltGrPostscriptOp.C | 4 |
3 files changed, 13 insertions, 8 deletions
diff --git a/src/bltConfig.C b/src/bltConfig.C index d76c4d1..879299b 100644 --- a/src/bltConfig.C +++ b/src/bltConfig.C @@ -173,7 +173,7 @@ static int ListSetProc(ClientData clientData, Tcl_Interp *interp, const char*** listPtr = (const char***)(widgRec + offset); *(double*)savePtr = *(double*)listPtr; - if (!listPtr) + if (!(*listPtr)) return TCL_OK; const char** argv; @@ -191,14 +191,14 @@ static Tcl_Obj* ListGetProc(ClientData clientData, Tk_Window tkwin, { const char*** listPtr = (const char***)(widgRec + offset); - if (!listPtr) + if (!(*listPtr)) return Tcl_NewListObj(0, NULL); // count how many int cnt=0; - for (const char** p = *listPtr; *p != NULL; p++,cnt++) {} + for (const char** p = *listPtr; *p; p++,cnt++) {} if (!cnt) - return Tcl_NewListObj(0, (Tcl_Obj**)NULL); + return Tcl_NewListObj(0, NULL); Tcl_Obj** ll = (Tcl_Obj**)calloc(cnt, sizeof(Tcl_Obj*)); for (int ii=0; ii<cnt; ii++) diff --git a/src/bltGrPSOutput.C b/src/bltGrPSOutput.C index cd10076..e43b370 100644 --- a/src/bltGrPSOutput.C +++ b/src/bltGrPSOutput.C @@ -609,10 +609,13 @@ int PostScript::preamble(const char* fileName) void PostScript::addComments(const char** comments) { - for (const char** p = comments; *p; p += 2) { - if (*(p+1) == NULL) + if (!comments) + return; + + for (const char** pp = comments; *pp; pp+=2) { + if (*(pp+1) == NULL) break; - format("%% %s: %s\n", *p, *(p+1)); + format("%% %s: %s\n", *pp, *(pp+1)); } } diff --git a/src/bltGrPostscriptOp.C b/src/bltGrPostscriptOp.C index 70c6474..576ab54 100644 --- a/src/bltGrPostscriptOp.C +++ b/src/bltGrPostscriptOp.C @@ -127,7 +127,9 @@ static int OutputOp(ClientData clientData, Tcl_Interp* interp, if (objc > 3) { fileName = Tcl_GetString(objv[3]); if (fileName[0] != '-') { - objv++, objc--; /* First argument is the file name. */ + // First argument is the file name + objv++, objc--; + channel = Tcl_OpenFileChannel(interp, fileName, "w", 0666); if (!channel) return TCL_ERROR; |