From: Ted Lemon Date: Sun, 18 Jul 1999 19:37:23 +0000 (+0000) Subject: Conditionalize use of snprintf. X-Git-Tag: V3-BETA-1-PATCH-2~5^2~189 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c72d02a7f85a9e3e9cd9d972fabdfb5bfc4d96e;p=thirdparty%2Fdhcp.git Conditionalize use of snprintf. --- diff --git a/common/nsupdate.c b/common/nsupdate.c index 0e789f71d..daf3ee6a9 100644 --- a/common/nsupdate.c +++ b/common/nsupdate.c @@ -25,7 +25,7 @@ #ifndef lint static char copyright[] = -"$Id: nsupdate.c,v 1.4 1999/07/12 22:43:08 mellon Exp $ Copyright (c) 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: nsupdate.c,v 1.5 1999/07/18 19:37:23 mellon Exp $ Copyright (c) 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -71,10 +71,15 @@ char *ddns_rev_name(lease, state, packet) lease->ip_addr.len); return NULL; } +#if defined (NO_SNPRINTF) + sprintf(revname, "%d.%d.%d.%d.%s.", + lease->ip_addr.iabuf[3], lease->ip_addr.iabuf[2], + lease->ip_addr.iabuf[1], lease->ip_addr.iabuf[0], revdomain); +#else snprintf(revname, MAXDNAME, "%d.%d.%d.%d.%s.", lease->ip_addr.iabuf[3], lease->ip_addr.iabuf[2], lease->ip_addr.iabuf[1], lease->ip_addr.iabuf[0], revdomain); - +#endif return revname; } @@ -158,11 +163,17 @@ char *ddns_fwd_name(lease, state, packet) return NULL; } +#if defined (NO_SNPRINTF) + if (sprintf(hostname, "%s.%s.", hostname, domain) < 0) { + log_error("nsupdate: Build FQDN failed"); + return NULL; + } +#else if (snprintf(hostname, MAXDNAME, "%s.%s.", hostname, domain) < 0) { log_error("nsupdate: Build FQDN failed"); return NULL; } - +#endif return hostname; }