 			{
 				// sending notification with button press time
 				char buf[10];
-				int len = snprintf(buf, 10, "%%%05lu", time);
+				int len = snprintf(buf, sizeof(buf), "%%%05lu", time);
 				udpSendPacket(buf, len);
 
 				if (isDoorLocked)

		reedToDebounce = false;
		// sending notification about door state
		char buf[12];
		int len = snprintf(buf, 12, "^%d|%08ld", door == DOOR_CLOSED ? 0 : 1, time);
		udpSendPacket(buf, len);

		if (door == DOOR_CLOSED)

		}
		if (door == DOOR_OPENED)
		{
			// when door are opened during locking time, unlock them, but only
			// within specific time since locking started (to prevent from opening
			// due to reed switch problems)
			if (isDoorLocked && doorRevertTimeout)
			{
				unlockDoor();
