[gvfs] client: Replace deprecated g_memmove
- From: Ross Lagerwall <rossl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] client: Replace deprecated g_memmove
- Date: Tue, 4 Nov 2014 21:57:44 +0000 (UTC)
commit 969421676c9d9f4ee4ca336acb567086af5d6c20
Author: Ross Lagerwall <rosslagerwall gmail com>
Date: Thu Oct 30 23:08:42 2014 +0000
client: Replace deprecated g_memmove
Replace a hand-rolled partial string duplication with g_strndup.
https://bugzilla.gnome.org/show_bug.cgi?id=739233
client/gdaemonfile.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 3373341..cff031b 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]