mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
only issue warning if callbacks is none NULL.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: loc_29.c,v 1.35 2002/02/10 23:52:26 marka Exp $ */
|
/* $Id: loc_29.c,v 1.36 2002/02/12 03:57:59 marka Exp $ */
|
||||||
|
|
||||||
/* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */
|
/* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */
|
||||||
|
|
||||||
@@ -49,7 +49,6 @@ fromtext_loc(ARGS_FROMTEXT) {
|
|||||||
unsigned long latitude;
|
unsigned long latitude;
|
||||||
unsigned long longitude;
|
unsigned long longitude;
|
||||||
unsigned long altitude;
|
unsigned long altitude;
|
||||||
void (*callback)(dns_rdatacallbacks_t *, const char *, ...);
|
|
||||||
|
|
||||||
REQUIRE(type == 29);
|
REQUIRE(type == 29);
|
||||||
|
|
||||||
@@ -58,11 +57,6 @@ fromtext_loc(ARGS_FROMTEXT) {
|
|||||||
UNUSED(origin);
|
UNUSED(origin);
|
||||||
UNUSED(downcase);
|
UNUSED(downcase);
|
||||||
|
|
||||||
if (callbacks != NULL && callbacks->warn != NULL)
|
|
||||||
callback = callbacks->warn;
|
|
||||||
else
|
|
||||||
callback = default_fromtext_callback;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Defaults.
|
* Defaults.
|
||||||
*/
|
*/
|
||||||
@@ -130,13 +124,13 @@ fromtext_loc(ARGS_FROMTEXT) {
|
|||||||
if (decvalue(*e++) < 0)
|
if (decvalue(*e++) < 0)
|
||||||
RETTOK(DNS_R_SYNTAX);
|
RETTOK(DNS_R_SYNTAX);
|
||||||
}
|
}
|
||||||
if (*l != '\0') {
|
if (*l != '\0' && callbacks != NULL) {
|
||||||
const char *file = isc_lex_getsourcename(lexer);
|
const char *file = isc_lex_getsourcename(lexer);
|
||||||
unsigned long line = isc_lex_getsourceline(lexer);
|
unsigned long line = isc_lex_getsourceline(lexer);
|
||||||
|
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
file = "UNKNOWN";
|
file = "UNKNOWN";
|
||||||
(*callback)(callbacks, "%s: %s:%u: '%s' extra "
|
(*callbacks->warn)(callbacks, "%s: %s:%u: '%s' extra "
|
||||||
"precision digits ignored",
|
"precision digits ignored",
|
||||||
"dns_rdata_fromtext", file, line,
|
"dns_rdata_fromtext", file, line,
|
||||||
DNS_AS_STR(token));
|
DNS_AS_STR(token));
|
||||||
@@ -215,13 +209,13 @@ fromtext_loc(ARGS_FROMTEXT) {
|
|||||||
if (decvalue(*e++) < 0)
|
if (decvalue(*e++) < 0)
|
||||||
RETTOK(DNS_R_SYNTAX);
|
RETTOK(DNS_R_SYNTAX);
|
||||||
}
|
}
|
||||||
if (*l != '\0') {
|
if (*l != '\0' && callbacks != NULL) {
|
||||||
const char *file = isc_lex_getsourcename(lexer);
|
const char *file = isc_lex_getsourcename(lexer);
|
||||||
unsigned long line = isc_lex_getsourceline(lexer);
|
unsigned long line = isc_lex_getsourceline(lexer);
|
||||||
|
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
file = "UNKNOWN";
|
file = "UNKNOWN";
|
||||||
(*callback)(callbacks, "%s: %s:%u: '%s' extra "
|
(*callbacks->warn)(callbacks, "%s: %s:%u: '%s' extra "
|
||||||
"precision digits ignored",
|
"precision digits ignored",
|
||||||
"dns_rdata_fromtext",
|
"dns_rdata_fromtext",
|
||||||
file, line, DNS_AS_STR(token));
|
file, line, DNS_AS_STR(token));
|
||||||
|
Reference in New Issue
Block a user