[gnome-terminal] Fix off-by-one
- From: Christian Persch <chpe src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-terminal] Fix off-by-one
- Date: Sun, 23 Aug 2009 19:52:38 +0000 (UTC)
commit 0a7cb631cd78b9e9a92266a33e70f0309fca6fac
Author: Christian Persch <chpe gnome org>
Date: Sun Aug 23 21:40:08 2009 +0200
Fix off-by-one
Get the array length before adding the terminal NULL, not afterwards.
src/terminal-app.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/terminal-app.c b/src/terminal-app.c
index bc5d957..d87069d 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -1717,7 +1717,7 @@ terminal_app_handle_options (TerminalApp *app,
}
#endif
- /* Make sure we option at least one window */
+ /* Make sure we open at least one window */
terminal_options_ensure_window (options);
for (lw = options->initial_windows; lw != NULL; lw = lw->next)
@@ -2014,8 +2014,8 @@ terminal_app_save_config (TerminalApp *app,
terminal_window_save_state (window, key_file, group);
}
- g_ptr_array_add (window_names_array, NULL);
len = window_names_array->len;
+ g_ptr_array_add (window_names_array, NULL);
window_names = (char **) g_ptr_array_free (window_names_array, FALSE);
g_key_file_set_string_list (key_file, TERMINAL_CONFIG_GROUP, TERMINAL_CONFIG_PROP_WINDOWS, (const char * const *) window_names, len);
g_strfreev (window_names);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]