diff options
author | Larry Ewing <lewing@ximian.com> | 2003-02-09 15:35:23 +0800 |
---|---|---|
committer | Larry Ewing <lewing@src.gnome.org> | 2003-02-09 15:35:23 +0800 |
commit | 352561d06b62e196987d020fe9f53093469a411b (patch) | |
tree | f0c8e484c45704735337ac6c056f894818b4e5f3 | |
parent | c792cf443ea005844153e1a152bac757cf477617 (diff) | |
download | gsoc2013-evolution-352561d06b62e196987d020fe9f53093469a411b.tar gsoc2013-evolution-352561d06b62e196987d020fe9f53093469a411b.tar.gz gsoc2013-evolution-352561d06b62e196987d020fe9f53093469a411b.tar.bz2 gsoc2013-evolution-352561d06b62e196987d020fe9f53093469a411b.tar.lz gsoc2013-evolution-352561d06b62e196987d020fe9f53093469a411b.tar.xz gsoc2013-evolution-352561d06b62e196987d020fe9f53093469a411b.tar.zst gsoc2013-evolution-352561d06b62e196987d020fe9f53093469a411b.zip |
fix length calculation. (create_folder_directory): remove alloca usage,
2003-02-09 Larry Ewing <lewing@ximian.com>
* e-local-storage.c (remove_folder_directory): fix length calculation.
(create_folder_directory): remove alloca usage, clears up crash.
svn path=/trunk/; revision=19856
-rw-r--r-- | shell/ChangeLog | 5 | ||||
-rw-r--r-- | shell/e-local-storage.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 94260f2f35..60f1b7abc1 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,8 @@ +2003-02-09 Larry Ewing <lewing@ximian.com> + + * e-local-storage.c (remove_folder_directory): fix length calculation. + (create_folder_directory): remove alloca usage, clears up crash. + 2003-02-07 Larry Ewing <lewing@ximian.com> * e-shell-folder-creation-dialog.c diff --git a/shell/e-local-storage.c b/shell/e-local-storage.c index 3b5d3fa86a..380f88fba4 100644 --- a/shell/e-local-storage.c +++ b/shell/e-local-storage.c @@ -358,17 +358,18 @@ create_folder_directory (ELocalStorage *local_storage, char *parent; /* Create the `subfolders' subdirectory under the parent. */ - parent = alloca(strlen(parent_path)+2); - sprintf(parent, "%s/", parent_path); + parent = g_strdup_printf ("%s/", parent_path); subfolders_directory_physical_path = e_path_to_physical (priv->base_path, parent); if (! g_file_test (subfolders_directory_physical_path, G_FILE_TEST_EXISTS)) { if (mkdir (subfolders_directory_physical_path, 0700) == -1) { g_free (subfolders_directory_physical_path); + g_free (parent); return errno_to_storage_result (); } } g_free (subfolders_directory_physical_path); + g_free (parent); } g_free (parent_path); @@ -501,7 +502,7 @@ remove_folder_directory (ELocalStorage *local_storage, char *subfolders_directory_physical_path; char *parent_path; - parent_path = g_strndup (path, folder_name - path); + parent_path = g_strndup (path, strlen (path) - strlen (folder_name)); subfolders_directory_physical_path = e_path_to_physical (priv->base_path, parent_path); g_free (parent_path); |