From 67f87db511a7284fbadf65bbf984480d1eaaeabc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 15 Oct 2013 22:01:46 +0200 Subject: UpdateArchive: use std::string for temporary string --- src/UpdateArchive.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/UpdateArchive.cxx') diff --git a/src/UpdateArchive.cxx b/src/UpdateArchive.cxx index b920b8303..6ec73c47a 100644 --- a/src/UpdateArchive.cxx +++ b/src/UpdateArchive.cxx @@ -33,7 +33,7 @@ #include "util/Error.hxx" #include "Log.hxx" -#include +#include #include @@ -42,14 +42,13 @@ update_archive_tree(Directory *directory, const char *name) { const char *tmp = strchr(name, '/'); if (tmp) { - char *child_name = g_strndup(name, tmp - name); + const std::string child_name(name, tmp); //add dir is not there already db_lock(); Directory *subdir = - directory->MakeChild(child_name); + directory->MakeChild(child_name.c_str()); subdir->device = DEVICE_INARCHIVE; db_unlock(); - g_free(child_name); //create directories first update_archive_tree(subdir, tmp+1); -- cgit v1.2.3