aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog5
-rw-r--r--shell/e-local-storage.c7
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);