diff options
Diffstat (limited to 'net/ax25')
-rw-r--r-- | net/ax25/ax25_addr.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c index dca179daf415..0164a155b8c4 100644 --- a/net/ax25/ax25_addr.c +++ b/net/ax25/ax25_addr.c | |||
@@ -67,37 +67,34 @@ char *ax2asc(char *buf, ax25_address *a) | |||
67 | /* | 67 | /* |
68 | * ascii -> ax25 conversion | 68 | * ascii -> ax25 conversion |
69 | */ | 69 | */ |
70 | ax25_address *asc2ax(char *callsign) | 70 | void asc2ax(ax25_address *addr, char *callsign) |
71 | { | 71 | { |
72 | static ax25_address addr; | ||
73 | char *s; | 72 | char *s; |
74 | int n; | 73 | int n; |
75 | 74 | ||
76 | for (s = callsign, n = 0; n < 6; n++) { | 75 | for (s = callsign, n = 0; n < 6; n++) { |
77 | if (*s != '\0' && *s != '-') | 76 | if (*s != '\0' && *s != '-') |
78 | addr.ax25_call[n] = *s++; | 77 | addr->ax25_call[n] = *s++; |
79 | else | 78 | else |
80 | addr.ax25_call[n] = ' '; | 79 | addr->ax25_call[n] = ' '; |
81 | addr.ax25_call[n] <<= 1; | 80 | addr->ax25_call[n] <<= 1; |
82 | addr.ax25_call[n] &= 0xFE; | 81 | addr->ax25_call[n] &= 0xFE; |
83 | } | 82 | } |
84 | 83 | ||
85 | if (*s++ == '\0') { | 84 | if (*s++ == '\0') { |
86 | addr.ax25_call[6] = 0x00; | 85 | addr->ax25_call[6] = 0x00; |
87 | return &addr; | 86 | return; |
88 | } | 87 | } |
89 | 88 | ||
90 | addr.ax25_call[6] = *s++ - '0'; | 89 | addr->ax25_call[6] = *s++ - '0'; |
91 | 90 | ||
92 | if (*s != '\0') { | 91 | if (*s != '\0') { |
93 | addr.ax25_call[6] *= 10; | 92 | addr->ax25_call[6] *= 10; |
94 | addr.ax25_call[6] += *s++ - '0'; | 93 | addr->ax25_call[6] += *s++ - '0'; |
95 | } | 94 | } |
96 | 95 | ||
97 | addr.ax25_call[6] <<= 1; | 96 | addr->ax25_call[6] <<= 1; |
98 | addr.ax25_call[6] &= 0x1E; | 97 | addr->ax25_call[6] &= 0x1E; |
99 | |||
100 | return &addr; | ||
101 | } | 98 | } |
102 | 99 | ||
103 | /* | 100 | /* |