diff options
author | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-07-01 23:36:51 +0000 |
---|---|---|
committer | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-07-01 23:36:51 +0000 |
commit | 11d2a55065c2c63ebece684e30913d8cfab5bdb0 (patch) | |
tree | 026a81373cfcbcfad75164ffeef600e21eacdeb8 /gtk/print_dlg.c | |
parent | d817e25e1af0b86b10ce86aacc2dbe6ec9a4f39b (diff) |
Updates to create_tempfile:
- Use g_get_tmp_dir, just like get_tempfile_path.
- Don't make the caller worry about the path buffer length.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28915 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/print_dlg.c')
-rw-r--r-- | gtk/print_dlg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c index 0a6f5b0224..55a2ffd343 100644 --- a/gtk/print_dlg.c +++ b/gtk/print_dlg.c @@ -908,7 +908,7 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w) #ifdef _WIN32 gboolean win_printer = FALSE; int tmp_fd; - char tmp_namebuf[128+1]; /* XX: see create_tmpfile which says [128+1]; why ? */ + char *tmp_namebuf; char *tmp_oldfile; #endif cf_print_status_t status; @@ -951,10 +951,10 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w) /* Don't use tmpnam() or such, as this will fail under some ACL */ /* circumstances: http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=358 */ /* Also: tmpnam is "insecure" and should not be used. */ - tmp_fd = create_tempfile(tmp_namebuf, sizeof(tmp_namebuf), "wshprint"); + tmp_fd = create_tempfile(&tmp_namebuf, "wshprint"); if(tmp_fd == -1) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, - "Couldn't create a temporary file for printing."); + "Couldn't create a temporary file for printing:\n%s", tmp_namebuf); return; } /* remember to restore these values later! */ |