summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDialog.c
diff options
context:
space:
mode:
authordas <das>2008-12-07 16:34:12 (GMT)
committerdas <das>2008-12-07 16:34:12 (GMT)
commitdad5f8c673f46f8a689841cdc0568fff52c5ef87 (patch)
treebc363e25b63d1114e0d291507eb02c7876149aa9 /macosx/tkMacOSXDialog.c
parent59bd7a0159445f73e970d56b2751c7b9a1924eca (diff)
downloadtk-dad5f8c673f46f8a689841cdc0568fff52c5ef87.zip
tk-dad5f8c673f46f8a689841cdc0568fff52c5ef87.tar.gz
tk-dad5f8c673f46f8a689841cdc0568fff52c5ef87.tar.bz2
Fix potential use of uninitialized variable flagged by clang static analyzer
Diffstat (limited to 'macosx/tkMacOSXDialog.c')
-rw-r--r--macosx/tkMacOSXDialog.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 9b1c22d..e592e3c 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.40 2008/12/07 16:32:44 das Exp $
+ * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.41 2008/12/07 16:34:12 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -315,7 +315,7 @@ Tk_GetOpenFileObjCmd(
}
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;
@@ -376,7 +376,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);
}
end: