 			// 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();
 		}
 


				udp.beginPacket(srvIp, 10000);
				udp.write("!");
				udp.write((const uint8_t*)readerCardNumber, LENGTH);
				udp.endPacket();
			}
			else
			{
				udp.beginPacket(srvIp, 10000);
				udp.write("@");
				udp.write((const uint8_t*)readerCardNumber, LENGTH);
				udp.endPacket();
				udpResponseTimeout = 1000;
			}

		{
			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();
