summaryrefslogtreecommitdiffstats
path: root/gnu/usr.sbin
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1995-07-02 18:48:21 +0000
committerwpaul <wpaul@FreeBSD.org>1995-07-02 18:48:21 +0000
commit77efe4f862c3e6af2497aa38019cb8387832c06a (patch)
tree745c8ecc50683d5a095ef79965aef8c463cddf03 /gnu/usr.sbin
parentd295fcd0723746eaaf90f53ac3d9dedcbc702077 (diff)
downloadFreeBSD-src-77efe4f862c3e6af2497aa38019cb8387832c06a.zip
FreeBSD-src-77efe4f862c3e6af2497aa38019cb8387832c06a.tar.gz
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.
Diffstat (limited to 'gnu/usr.sbin')
-rw-r--r--gnu/usr.sbin/ypserv/server.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gnu/usr.sbin/ypserv/server.c b/gnu/usr.sbin/ypserv/server.c
index 95ccd70..a0e48dc 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 <wpaul@ctr.columbia.edu>
**
-** $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;
}
OpenPOWER on IntegriCloud