Fix build warnings for gcc9
[platform/core/telephony/tel-plugin-vmodem.git] / src / vdpram_dump.c
index 09c0e1a..8e0fd11 100644 (file)
@@ -41,10 +41,10 @@ static void hex_dump(const char *pad, int size, const void *data)
 
        p = (unsigned const char *)data;
 
-       snprintf(buf, 255, "%s%04X: ", pad, 0);
+       snprintf(buf, sizeof(buf), "%s%04X: ", pad, 0);
        for (i = 0; i < size; i++) {
                snprintf(hex, 4, "%02X ", p[i]);
-               strncat(buf, hex, strlen(hex));
+               strncat(buf, hex, sizeof(buf) - strlen(buf) - 1);
 
                if ((i + 1) % 8 == 0) {
                        if ((i + 1) % 16 == 0) {