patty_ax25_pton(): Make calls ending in - invalid
This commit is contained in:
parent
8f01ab1cd4
commit
52350ad0e8
1 changed files with 7 additions and 1 deletions
|
@ -23,6 +23,8 @@ int patty_ax25_pton(const char *callsign,
|
|||
|
||||
enum addr_state state = ADDR_CALLSIGN;
|
||||
|
||||
uint8_t c = '\0';
|
||||
|
||||
if (len == 0) {
|
||||
goto error_invalid_callsign;
|
||||
} else if (len > PATTY_AX25_ADDRSTRLEN) {
|
||||
|
@ -30,7 +32,7 @@ int patty_ax25_pton(const char *callsign,
|
|||
}
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
uint8_t c = callsign[i];
|
||||
c = callsign[i];
|
||||
|
||||
switch (state) {
|
||||
case ADDR_CALLSIGN:
|
||||
|
@ -64,6 +66,10 @@ int patty_ax25_pton(const char *callsign,
|
|||
}
|
||||
}
|
||||
|
||||
if (c == '-') {
|
||||
goto error_invalid_callsign;
|
||||
}
|
||||
|
||||
while (o < PATTY_AX25_CALLSTRLEN) {
|
||||
addr->callsign[o++] = ' ' << 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue