summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd/db.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-09-16 18:35:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-09-16 18:35:44 +0000
commite079edd2e9335fd24f8f6b8a69a82f9abdcf8332 (patch)
treeb94b092ed2307c805328cd2bf70b3c136f0ad696 /usr.sbin/dhcpd/db.c
parenta91fce241ec0acb77eeb44fdb6a2c82f6498e116 (diff)
avoid aliasing with libc functions; ok henning
Diffstat (limited to 'usr.sbin/dhcpd/db.c')
-rw-r--r--usr.sbin/dhcpd/db.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/dhcpd/db.c b/usr.sbin/dhcpd/db.c
index 3afa66b8e0b..8df804ceaa4 100644
--- a/usr.sbin/dhcpd/db.c
+++ b/usr.sbin/dhcpd/db.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db.c,v 1.9 2004/07/29 11:58:41 henning Exp $ */
+/* $OpenBSD: db.c,v 1.10 2004/09/16 18:35:42 deraadt Exp $ */
/*
* Persistent database management routines for DHCPD.
@@ -100,15 +100,16 @@ write_lease(struct lease *lease)
}
if (lease->uid_len) {
- int i;
+ int j;
+
errno = 0;
fprintf(db_file, "\n\tuid %2.2x", lease->uid[0]);
if (errno)
++errors;
- for (i = 1; i < lease->uid_len; i++) {
+ for (j = 1; j < lease->uid_len; j++) {
errno = 0;
- fprintf(db_file, ":%2.2x", lease->uid[i]);
+ fprintf(db_file, ":%2.2x", lease->uid[j]);
if (errno)
++errors;
}
@@ -239,7 +240,7 @@ new_lease_file(void)
write_leases();
fflush(db_file);
- ftruncate(fileno(db_file), ftell(db_file));
+ ftruncate(fileno(db_file), ftello(db_file));
fsync(fileno(db_file));
counting = 1;