GNOME Bugzilla – Bug 739233
replace deprecated g_memmove by memmove
Last modified: 2014-11-04 21:58:34 UTC
Created attachment 289396 [details] [review] patch g_memmove was deprecated in glib-2.0 V 2.40 [1] [1] https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-memmove
Review of attachment 289396 [details] [review]: Looks good, thanks!
Review of attachment 289396 [details] [review]: Shouldn't this be a memcpy instead? I don't see why it should be a memmove. Since the destination is newly allocated, the src and dst shouldn't overlap.
You are right, memmove isn't necessary and memcpy is faster. Or use g_memdup instead?
(In reply to comment #3) > You are right, memmove isn't necessary and memcpy is faster. Or use g_memdup > instead? Probably not, because we allocate (len + 1) bytes but only want to copy len bytes.
Created attachment 289705 [details] [review] client: Replace deprecated g_memmove Replace a hand-rolled partial string duplication with g_strndup.
Or we could use g_strndup to do exactly what's required :-)
Review of attachment 289705 [details] [review]: That's better :-D
Pushed to master as 969421676c9d9f4ee4ca336acb567086af5d6c20. Thanks for the review!