move a variable declaration to the right place
authorFelix Fietkau <nbd@openwrt.org>
Thu, 2 Oct 2014 09:42:15 +0000 (11:42 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 2 Oct 2014 09:42:15 +0000 (11:42 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
commands-wms.c

index 825480b60b9d77bf67ea32361261109be73aee1f..e3744c1c5cdf8f7966b4023f58fa656ae49d0709 100644 (file)
@@ -246,9 +246,9 @@ pdu_decode_address(char *str, unsigned char *data, int len)
        *str = 0;
 }
 
-static void wms_decode_address(char *str, char *name, unsigned char *data, int len)
+static void wms_decode_address(char *name, unsigned char *data, int len)
 {
-       str = blobmsg_alloc_string_buffer(&status, name, len * 2 + 2);
+       char *str = blobmsg_alloc_string_buffer(&status, name, len * 2 + 2);
        pdu_decode_address(str, data, len);
        blobmsg_add_string_buffer(&status);
 }
@@ -273,7 +273,7 @@ static void cmd_wms_get_message_cb(struct qmi_dev *qmi, struct qmi_request *req,
                return;
 
        if (cur_len) {
-               wms_decode_address(str, "smsc", data, cur_len - 1);
+               wms_decode_address("smsc", data, cur_len - 1);
                data += cur_len;
        }
 
@@ -291,7 +291,7 @@ static void cmd_wms_get_message_cb(struct qmi_dev *qmi, struct qmi_request *req,
 
        if (cur_len) {
                cur_len = (cur_len + 1) / 2;
-               wms_decode_address(str, sent ? "receiver" : "sender", data, cur_len);
+               wms_decode_address(sent ? "receiver" : "sender", data, cur_len);
                data += cur_len + 1;
        }