2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

1458. [cleanup] sprintf() -> snprintf().

This commit is contained in:
Mark Andrews
2003-04-11 07:25:31 +00:00
parent 935000aa6e
commit 806c235ecf
16 changed files with 83 additions and 69 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.c,v 1.216 2003/01/24 04:25:53 marka Exp $ */
/* $Id: message.c,v 1.217 2003/04/11 07:25:25 marka Exp $ */
/***
*** Imports
@@ -3023,7 +3023,7 @@ dns_message_totext(dns_message_t *msg, const dns_master_style_t *style,
ADD_STRING(target, ", status: ");
ADD_STRING(target, rcodetext[msg->rcode]);
ADD_STRING(target, ", id: ");
sprintf(buf, "%6u", msg->id);
snprintf(buf, sizeof(buf), "%6u", msg->id);
ADD_STRING(target, buf);
ADD_STRING(target, "\n;; flags: ");
if ((msg->flags & DNS_MESSAGEFLAG_QR) != 0)
@@ -3045,24 +3045,28 @@ dns_message_totext(dns_message_t *msg, const dns_master_style_t *style,
} else {
ADD_STRING(target, "; ZONE: ");
}
sprintf(buf, "%1u", msg->counts[DNS_SECTION_QUESTION]);
snprintf(buf, sizeof(buf), "%1u",
msg->counts[DNS_SECTION_QUESTION]);
ADD_STRING(target, buf);
if (msg->opcode != dns_opcode_update) {
ADD_STRING(target, ", ANSWER: ");
} else {
ADD_STRING(target, ", PREREQ: ");
}
sprintf(buf, "%1u", msg->counts[DNS_SECTION_ANSWER]);
snprintf(buf, sizeof(buf), "%1u",
msg->counts[DNS_SECTION_ANSWER]);
ADD_STRING(target, buf);
if (msg->opcode != dns_opcode_update) {
ADD_STRING(target, ", AUTHORITY: ");
} else {
ADD_STRING(target, ", UPDATE: ");
}
sprintf(buf, "%1u", msg->counts[DNS_SECTION_AUTHORITY]);
snprintf(buf, sizeof(buf), "%1u",
msg->counts[DNS_SECTION_AUTHORITY]);
ADD_STRING(target, buf);
ADD_STRING(target, ", ADDITIONAL: ");
sprintf(buf, "%1u", msg->counts[DNS_SECTION_ADDITIONAL]);
snprintf(buf, sizeof buf, "%1u",
msg->counts[DNS_SECTION_ADDITIONAL]);
ADD_STRING(target, buf);
ADD_STRING(target, "\n");
}