summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordas <das>2008-12-07 16:57:52 (GMT)
committerdas <das>2008-12-07 16:57:52 (GMT)
commit99c1fca7d46437c5c91f8758e9ac3c2acd84a3b7 (patch)
tree7c9470348bc542b23f1a6949a8fd7e209b8ed391 /macosx
parent77051f4528b5bf5aa5131c18882971f1c10ce1e9 (diff)
downloadtk-99c1fca7d46437c5c91f8758e9ac3c2acd84a3b7.zip
tk-99c1fca7d46437c5c91f8758e9ac3c2acd84a3b7.tar.gz
tk-99c1fca7d46437c5c91f8758e9ac3c2acd84a3b7.tar.bz2
Fix potential use of uninitialized variable flagged by clang static analyzer
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXDialog.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index ac65208..2253d07 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.4.2.22 2008/12/07 16:53:21 das Exp $
+ * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.4.2.23 2008/12/07 16:57:52 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -317,7 +317,7 @@ Tk_GetOpenFileObjCmd(
if (choiceLen == 0) { initialDir = NULL; }
break;
case OPEN_INITFILE:
- initialFile = Tcl_GetString(objv[i + 1]);
+ initialFile = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
/* empty strings should be like no selection given */
if (choiceLen == 0) { initialFile = NULL; }
break;
@@ -382,7 +382,8 @@ Tk_GetOpenFileObjCmd(
while (filterPtr && i-- > 0) {
filterPtr = filterPtr->next;
}
- Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr), filterPtr->name, 0);
+ Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr), filterPtr ?
+ filterPtr->name : "", 0);
}
#endif