summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2009-09-10 16:53:28 +0000
committerRalf Baechle <ralf@linux-mips.org>2009-09-10 16:53:28 +0000
commit24b463104d183755b540f966ee2fee4d891589e2 (patch)
tree8f9e18f3b255971cae52ef1c848c10512b770dd2
parent07e0485950387c5a626a36563d5cc593534a7695 (diff)
ax25_ntoa: Don't emit SSID suffix if the SSID is zero.
From: Matti Aarnio OH2MQK <matti.aarnio@zmailer.org>
-rw-r--r--ChangeLog5
-rw-r--r--axutils.c15
2 files changed, 14 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 4edd350..91b76c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+ * ax25_ntoa() does no longer print a zero SSID. This avoids addresses
+ like AB3DEF-0 which is general convention anyway.
+
+ -- Ralf Baechle DL5RB <ralf@linux-mips.org> Thu, 10 Sep 2009 18:52:00 +0200
+
libax25 0.0.12
* Fix numerous warnings triggered by modern compilers
* Updated to recent autoconf and automake version to keep the code
diff --git a/axutils.c b/axutils.c
index 3fbaa3e..f6e8713 100644
--- a/axutils.c
+++ b/axutils.c
@@ -198,14 +198,17 @@ char *ax25_ntoa(const ax25_address *a)
if (c != ' ') *s++ = c;
}
- *s++ = '-';
+ /* Convention is: -0 suffixes are NOT printed */
+ if (a->ax25_call[6] & 0x1E) {
+ *s++ = '-';
- if ((n = ((a->ax25_call[6] >> 1) & 0x0F)) > 9) {
- *s++ = '1';
- n -= 10;
+ if ((n = ((a->ax25_call[6] >> 1) & 0x0F)) > 9) {
+ *s++ = '1';
+ n -= 10;
+ }
+ *s++ = n + '0';
}
-
- *s++ = n + '0';
+
*s++ = '\0';
return buf;