From a8477654bafb625470825af34b073e85358e27ba Mon Sep 17 00:00:00 2001 From: jdamico Date: Sat, 11 Nov 2023 15:57:24 -0300 Subject: [PATCH] fixed Packet toString when there is no digi path --- src/main/java/org/jdamico/javax25/App.java | 3 +-- src/main/java/org/jdamico/javax25/ax25/Packet.java | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jdamico/javax25/App.java b/src/main/java/org/jdamico/javax25/App.java index c3c2f96..18cdda2 100644 --- a/src/main/java/org/jdamico/javax25/App.java +++ b/src/main/java/org/jdamico/javax25/App.java @@ -14,8 +14,7 @@ */ public class App { - public static void main( String[] args ) - { + public static void main( String[] args) { Soundcard.enumerate(); Properties p = System.getProperties(); diff --git a/src/main/java/org/jdamico/javax25/ax25/Packet.java b/src/main/java/org/jdamico/javax25/ax25/Packet.java index 5dea214..746dc7e 100644 --- a/src/main/java/org/jdamico/javax25/ax25/Packet.java +++ b/src/main/java/org/jdamico/javax25/ax25/Packet.java @@ -140,6 +140,9 @@ public Packet(String destination, int control, int protocol, byte[] payload) { + + if(path == null) path = new String[] {}; + int n = 7 + 7 + 7*path.length + 2 + payload.length; byte[] bytes = new byte[n];