Peter Eisch: CentOS lacks strlcat(3), so use snprintf(3) to crack the

nut.
This commit is contained in:
agc 2007-12-20 23:17:05 +00:00
parent 9b6e62c6a8
commit 7683937c60
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netmask.c,v 1.9 2007/11/12 23:25:42 agc Exp $ */
/* $NetBSD: netmask.c,v 1.10 2007/12/20 23:17:05 agc Exp $ */
/*
* Copyright © 2006 Alistair Crooks. All rights reserved.
@ -113,7 +113,8 @@ allow_netmask(const char *netmaskarg, const char *addr)
}
}
for ( ; i < 3 ; i++) {
(void) strlcat(maskaddr, ".0", sizeof(maskaddr));
(void) snprintf(cp, sizeof(maskaddr) - (int)(cp - maskaddr), ".0");
cp += 2;
}
/* translate netmask to in_addr */