summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2014-10-30 23:08:42 +0000
committerRoss Lagerwall <rosslagerwall@gmail.com>2014-11-04 21:57:02 +0000
commit969421676c9d9f4ee4ca336acb567086af5d6c20 (patch)
treeccc6e06c6384fd51cda0e7fcd618b9711ea3f4e3 /client
parent7757c2bcfef808c860ec0e8676d69301a0f821d1 (diff)
downloadgvfs-969421676c9d9f4ee4ca336acb567086af5d6c20.tar.gz
client: Replace deprecated g_memmove
Replace a hand-rolled partial string duplication with g_strndup. https://bugzilla.gnome.org/show_bug.cgi?id=739233
Diffstat (limited to 'client')
-rw-r--r--client/gdaemonfile.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 33733411..cff031b7 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -246,7 +246,6 @@ g_daemon_file_get_parent (GFile *file)
GFile *parent;
const char *base;
char *parent_path;
- gsize len;
path = daemon_file->path;
base = strrchr (path, '/');
@@ -257,12 +256,7 @@ g_daemon_file_get_parent (GFile *file)
while (base > path && *base == '/')
base--;
- len = (guint) 1 + base - path;
-
- parent_path = g_new (gchar, len + 1);
- g_memmove (parent_path, path, len);
- parent_path[len] = 0;
-
+ parent_path = g_strndup (path, (guint) 1 + base - path);
parent = new_file_for_new_path (daemon_file, parent_path);
g_free (parent_path);