[FIX] MD5 sum in MSG_BINARY_ACK 00/29600/2
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Thu, 30 Oct 2014 09:18:46 +0000 (12:18 +0300)
committerVitaliy Cherepanov <v.cherepanov@samsung.com>
Thu, 30 Oct 2014 10:37:53 +0000 (13:37 +0300)
Change-Id: Ie5b8420a255577c355914c1c50748d943e45ca83
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
daemon/da_protocol.c

index 14f5b86..8bdc540 100644 (file)
@@ -776,7 +776,10 @@ static size_t binary_ack_pack(char *s, const struct binary_ack *ba)
        s += len;
 
        for (i = 0; i!= 16; ++i) {
-               snprintf(s, 2, "%02x", ba->digest[i]);
+               /* we should use snprintf, snprintf prints data including
+                * terminate '\0' so we need print 3 symbols
+                */
+               snprintf(s, 3, "%02x", ba->digest[i]);
                s += 2;
        }
        *s = '\0';