stk: Fix sizeof on memcpy
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 22 May 2013 23:01:47 +0000 (20:01 -0300)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 23 May 2013 02:37:52 +0000 (21:37 -0500)
src/stk.c: In function ‘__ofono_cbs_sim_download’:
src/stk.c:283:45: error: argument to ‘sizeof’ in ‘memcpy’ call is the
same expression as the source; did you mean to dereference it?
[-Werror=sizeof-pointer-memaccess]
  memcpy(&e.cbs_pp_download.page, msg, sizeof(msg));
                                               ^

src/stk.c

index 7974751..01c95b5 100644 (file)
--- a/src/stk.c
+++ b/src/stk.c
@@ -280,7 +280,7 @@ void __ofono_cbs_sim_download(struct ofono_stk *stk, const struct cbs *msg)
 
        e.type = STK_ENVELOPE_TYPE_CBS_PP_DOWNLOAD;
        e.src = STK_DEVICE_IDENTITY_TYPE_NETWORK;
-       memcpy(&e.cbs_pp_download.page, msg, sizeof(msg));
+       memcpy(&e.cbs_pp_download.page, msg, sizeof(*msg));
 
        err = stk_send_envelope(stk, &e, stk_cbs_download_cb,
                                ENVELOPE_RETRIES_DEFAULT);