From d32dc73f835d9c9bdcb445a470e7818508300f3b Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Sun, 2 Jul 1995 18:48:21 +0000 Subject: Small touchups in open_database(): - Use one sprintf() to put together the path to the map database instead of strcat()s and strcpy()s. - Make the 'error opening database' Perror() statement sane. --- gnu/usr.sbin/ypserv/server.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gnu') diff --git a/gnu/usr.sbin/ypserv/server.c b/gnu/usr.sbin/ypserv/server.c index 95ccd707699f..a0e48dc76898 100644 --- a/gnu/usr.sbin/ypserv/server.c +++ b/gnu/usr.sbin/ypserv/server.c @@ -24,7 +24,7 @@ ** Ported to FreeBSD and hacked all to pieces ** by Bill Paul ** -** $Id: server.c,v 1.5 1995/05/03 14:36:12 wpaul Exp $ +** $Id: server.c,v 1.6 1995/05/30 05:05:35 rgrimes Exp $ ** */ @@ -297,14 +297,12 @@ static DB *open_database(const char *domain, if (map[0] == '.' || strchr(map, '/')) return 0; - strcpy(buf, domain); - strcat(buf, "/"); - strcat(buf, map); + sprintf (buf, "%s/%s", domain, map); dbp = dbopen(buf,O_RDONLY|O_EXCL, PERM_SECURE, DB_HASH, &openinfo); if (debug_flag > 1 && dbp == NULL) - Perror("dbopen(): ",strerror(errno)); + Perror("dbopen(%s): %s", map, strerror(errno)); return dbp; } -- cgit v1.3