summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2009-10-20 04:01:52 +0200
committerJavier Jardón <jjardon@gnome.org>2009-10-20 20:38:14 +0200
commit232fca6e9587041c12d9b81e19d721c661c24207 (patch)
tree13aa6fbc2e3b86a08c98303cfa19772b86f7bdfd /tests
parentd3155bb1eaf81a6175dff0347d7e6e146735a4d4 (diff)
downloadgtk+-232fca6e9587041c12d9b81e19d721c661c24207.tar.gz
Fix compilation warning
Use g_get_current_dir() instead getcwd()
Diffstat (limited to 'tests')
-rw-r--r--tests/testfilechooserbutton.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/testfilechooserbutton.c b/tests/testfilechooserbutton.c
index fccf0ce050..357bafbf27 100644
--- a/tests/testfilechooserbutton.c
+++ b/tests/testfilechooserbutton.c
@@ -33,10 +33,6 @@
#include <gtk/gtk.h>
-#ifdef G_OS_WIN32
-#include <direct.h> /* for _getcwd() */
-#endif
-
#include "prop-editor.h"
static gchar *backend = "gtk+";
@@ -267,7 +263,7 @@ main (int argc,
GtkWidget *hbox, *label, *chooser, *button;
GtkSizeGroup *label_group;
GOptionContext *context;
- gchar cwd[2048];
+ gchar *cwd;
context = g_option_context_new ("- test GtkFileChooserButton widget");
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
@@ -281,8 +277,9 @@ main (int argc,
if (rtl)
gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
- getcwd (cwd, sizeof (cwd));
+ cwd = g_get_current_dir();
gtk_src_dir = g_path_get_dirname (cwd);
+ g_free (cwd);
win = gtk_dialog_new_with_buttons ("TestFileChooserButton", NULL, GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_QUIT, GTK_RESPONSE_CLOSE, NULL);