summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordas <das>2008-12-07 16:57:44 (GMT)
committerdas <das>2008-12-07 16:57:44 (GMT)
commitfff794a9e62240c17442367024b0f61bc9293561 (patch)
treeba1113006ad8cb955ebc594c38c2c78fc823d9cf /macosx
parentd11cdfb23ba9bdb17b3460adc30ba947d323269c (diff)
downloadtk-fff794a9e62240c17442367024b0f61bc9293561.zip
tk-fff794a9e62240c17442367024b0f61bc9293561.tar.gz
tk-fff794a9e62240c17442367024b0f61bc9293561.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 b897162..35af0de 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.36.2.4 2008/12/07 16:48:00 das Exp $
+ * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.36.2.5 2008/12/07 16:57:44 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: