diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2003-03-13 10:31:45 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2003-03-13 10:31:45 +0000 |
commit | 88efdbc759f31065d8399de138903a9f1a42a71f (patch) | |
tree | a3d8ab2dd12d3607ff2c1a1dd1673da612a1315a /sbin/isakmpd | |
parent | 4e04c4424f0cbd3a7b1082bb1e704c38407b6620 (diff) |
Avoid "j += snprintf()". niklas@ ok.
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r-- | sbin/isakmpd/util.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/isakmpd/util.c b/sbin/isakmpd/util.c index 4233356ebdf..1f595c4b736 100644 --- a/sbin/isakmpd/util.c +++ b/sbin/isakmpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.31 2003/03/06 14:22:13 cedric Exp $ */ +/* $OpenBSD: util.c,v 1.32 2003/03/13 10:31:44 ho Exp $ */ /* $EOM: util.c,v 1.23 2000/11/23 12:22:08 niklas Exp $ */ /* @@ -401,9 +401,10 @@ sockaddr2text (struct sockaddr *sa, char **address, int zflag) for (i = 0, j = 0; i < 8; i++) { - j += snprintf ((*address) + j, addrlen - j, "%02x%02x", - ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr[2 * i], - ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr[2 * i + 1]); + snprintf ((*address) + j, addrlen - j, "%02x%02x", + ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr[2 * i], + ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr[2 * i + 1]); + j += 4; (*address)[j] = (j < (addrlen - 1)) ? ':' : '\0'; j++; } |