diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-08-19 01:51:35 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-08-19 01:51:35 +0000 |
commit | 3253f2618c3de37e5c3edbacf838d3961a28d2c7 (patch) | |
tree | 14c7f90a946ef9f73eada376a93e300e06af9979 /sbin/ifconfig | |
parent | dbc7ea089eda2b96bc8ee6f8e394685a64e9cb04 (diff) |
fix buffer underrun on 1.51
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 494f29b771e..aeeb84c5565 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.51 2001/08/18 20:39:43 deraadt Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.52 2001/08/19 01:51:34 itojun Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -81,7 +81,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94"; #else -static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.51 2001/08/18 20:39:43 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.52 2001/08/19 01:51:34 itojun Exp $"; #endif #endif /* not lint */ @@ -2385,21 +2385,21 @@ sec2str(total) n = snprintf(p, end - p, "%dd", days); if (n < 0 || n >= end - p) return(result); - p -= n; + p += n; } if (!first || hours) { first = 0; n = snprintf(p, end - p, "%dh", hours); if (n < 0 || n >= end - p) return(result); - p -= n; + p += n; } if (!first || mins) { first = 0; n = snprintf(p, end - p, "%dm", mins); if (n < 0 || n >= end - p) return(result); - p -= n; + p += n; } snprintf(p, end - p, "%ds", secs); } else |