 			// sending notification about door state
 			udp.beginPacket(srvIp, 10000);
 			char buf[10];
-			sprintf(buf, "^%d|%06ld", door == close ? 0 : 1, time);
-			udp.write(buf);
+			int len = snprintf(buf, 10, "^%d|%06ld", door == close ? 0 : 1, time);
+			udp.write((uint8_t*)buf, len);
 			udp.endPacket();
 		}
 

				// sending notification with button press time
				udp.beginPacket(srvIp, 10000);
				char buf[10];
				sprintf(buf, "%%%05d", time);
				udp.write(buf);
				udp.endPacket();

				if (isDoorLocked)

		{
			char msgBuf[3];
			udp.read(msgBuf, 3);
			if (udpResponseTimeout) // process only if we are waiting for any response packet
			{
				if (strncmp(msgBuf, ">CO", 3) == 0)
					cardAccepted();
