mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 06:49:58 -04:00
Correctly encode LOC records with non integer negative altitudes.
This commit is contained in:
parent
888dfd78c7
commit
337cc878fa
1 changed files with 7 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ fromtext_loc(ARGS_FROMTEXT) {
|
|||
unsigned char version;
|
||||
bool east = false;
|
||||
bool north = false;
|
||||
bool negative = false;
|
||||
long tmp;
|
||||
long m;
|
||||
long cm;
|
||||
|
|
@ -280,6 +281,9 @@ getalt:
|
|||
*/
|
||||
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
|
||||
false));
|
||||
if (DNS_AS_STR(token)[0] == '-') {
|
||||
negative = true;
|
||||
}
|
||||
m = strtol(DNS_AS_STR(token), &e, 10);
|
||||
if (*e != 0 && *e != '.' && *e != 'm') {
|
||||
RETTOK(DNS_R_SYNTAX);
|
||||
|
|
@ -324,6 +328,9 @@ getalt:
|
|||
/*
|
||||
* Adjust base.
|
||||
*/
|
||||
if (m < 0 || negative) {
|
||||
cm = -cm;
|
||||
}
|
||||
altitude = m + 100000;
|
||||
altitude *= 100;
|
||||
altitude += cm;
|
||||
|
|
|
|||
Loading…
Reference in a new issue