-/* $OpenBSD: print.c,v 1.4 1996/08/02 12:10:39 deraadt Exp $ */
+/* $OpenBSD: print.c,v 1.5 1996/09/15 23:13:03 millert Exp $ */
/* $NetBSD: print.c,v 1.11 1996/05/07 18:20:10 jtc Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: print.c,v 1.4 1996/08/02 12:10:39 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.5 1996/09/15 23:13:03 millert Exp $";
#endif
#endif /* not lint */
if (fmt != BSD && cc[p->sub] == p->def)
continue;
#define WD "%-8s"
- (void)sprintf(buf1 + cnt * 8, WD, p->name);
- (void)sprintf(buf2 + cnt * 8, WD, ccval(p, cc[p->sub]));
+ (void)snprintf(buf1 + cnt * 8, sizeof(buf1) - cnt * 8,
+ WD, p->name);
+ (void)snprintf(buf2 + cnt * 8, sizeof(buf2) - cnt * 8,
+ WD, ccval(p, cc[p->sub]));
if (++cnt == LINELENGTH / 8) {
cnt = 0;
(void)printf("%s\n", buf1);
-/* $Id: acl_files.c,v 1.2 1995/12/14 08:43:39 tholo Exp $ */
+/* $Id: acl_files.c,v 1.3 1996/09/15 23:17:59 millert Exp $ */
/*-
* Copyright (C) 1989 by the Massachusetts Institute of Technology
if(stat(acl_file, &s) < 0) return(NULL);
mode = s.st_mode;
- sprintf(new, NEW_FILE, acl_file);
+ snprintf(new, sizeof(new), NEW_FILE, acl_file);
for(;;) {
/* Open the new file */
if((nfd = open(new, O_WRONLY|O_CREAT|O_EXCL, mode)) < 0) {
fclose(f);
return(-1);
} else {
- sprintf(new, NEW_FILE, acl_file);
+ snprintf(new, sizeof(new), NEW_FILE, acl_file);
ret = unlink(new);
fclose(f);
return(ret);
int ret;
struct stat s;
- sprintf(new, NEW_FILE, acl_file);
+ snprintf(new, sizeof(new), NEW_FILE, acl_file);
if(fflush(f) < 0
|| fstat(fileno(f), &s) < 0
|| s.st_nlink == 0) {
realm = strchr(canon, REALM_SEP);
*strchr(canon, INST_SEP) = '\0'; /* Chuck the instance */
- sprintf(buf, "%s.*%s", canon, realm);
+ snprintf(buf, sizeof(buf), "%s.*%s", canon, realm);
if(acl_exact_match(acl, buf)) return(1);
- sprintf(buf, "*.*%s", realm);
+ snprintf(buf, sizeof(buf), "*.*%s", realm);
if(acl_exact_match(acl, buf) || acl_exact_match(acl, "*.*@*")) return(1);
return(0);