Merge from master to connectivity-abstraction branch
[platform/upstream/iotivity.git] / resource / csdk / connectivity / lib / libcoap-4.1.1 / examples / tiny.c
index 6bb89c8..7b7d437 100644 (file)
@@ -40,7 +40,7 @@ make_pdu(unsigned int value)
     enc = COAP_PSEUDOFP_ENCODE_8_4_DOWN(value,ls);
     coap_add_data(pdu, 1, &enc);
 
-    len = sprintf((char *) buf, "%u", COAP_PSEUDOFP_DECODE_8_4(enc));
+    len = snprintf((char *) buf, sizeof(buf), "%u", COAP_PSEUDOFP_DECODE_8_4(enc));
     if (len > 0)
     {
         coap_add_data(pdu, len, buf);