From 1bda9524add969e315d870f284046ecf1097f956 Mon Sep 17 00:00:00 2001
From: 826220679@qq.com <826220679@qq.com>
Date: 星期日, 24 八月 2025 18:01:25 +0800
Subject: [PATCH] 修改

---
 src/udptcp/UDPPortAReceiver.java |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/udptcp/UDPPortAReceiver.java b/src/udptcp/UDPPortAReceiver.java
index 29b5f97..6739b3f 100644
--- a/src/udptcp/UDPPortAReceiver.java
+++ b/src/udptcp/UDPPortAReceiver.java
@@ -8,6 +8,7 @@
 
 import dell_system.MessageViewPanel;
 import dell_targets.Dell_SystemConfiguration;
+import publicsWay.PacketProcessingSystem;
 
 public class UDPPortAReceiver {
 	public static final int PORT =Dell_SystemConfiguration.hexport;
@@ -104,10 +105,10 @@
 	}
 
 	private static String bytesToHex(byte[] bytes, int length) {
+	    if (bytes == null || length <= 0) return "";
 	    StringBuilder sb = new StringBuilder();
-	    for (int i = 0; i < length; i++) {
-	        // 确保生成大写、无分隔符的十六进制
-	        sb.append(String.format("%02X", bytes[i]));
+	    for (int i = 0; i < length && i < bytes.length; i++) {
+	        sb.append(String.format("%02X", bytes[i] & 0xFF));
 	    }
 	    return sb.toString();
 	}

--
Gitblit v1.9.3