Delete dead code in sec2str().

This commit is contained in:
dyoung 2008-05-11 22:16:29 +00:00
parent 8ae5a779c6
commit 3df1d7792b

View File

@ -1,4 +1,4 @@
/* $NetBSD: af_inet6.c,v 1.15 2008/05/11 22:12:04 dyoung Exp $ */
/* $NetBSD: af_inet6.c,v 1.16 2008/05/11 22:16:29 dyoung Exp $ */
/*
* Copyright (c) 1983, 1993
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: af_inet6.c,v 1.15 2008/05/11 22:12:04 dyoung Exp $");
__RCSID("$NetBSD: af_inet6.c,v 1.16 2008/05/11 22:16:29 dyoung Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -113,44 +113,9 @@ static char *
sec2str(time_t total)
{
static char result[256];
int days, hours, mins, secs;
int first = 1;
char *p = result;
char *end = &result[sizeof(result)];
int n;
snprintf(result, sizeof(result), "%lu", (u_long)total);
if (0) { /*XXX*/
days = total / 3600 / 24;
hours = (total / 3600) % 24;
mins = (total / 60) % 60;
secs = total % 60;
if (days) {
first = 0;
n = snprintf(p, end - p, "%dd", days);
if (n < 0 || n >= end - p)
return(result);
p += n;
}
if (!first || hours) {
first = 0;
n = snprintf(p, end - p, "%dh", hours);
if (n < 0 || n >= end - p)
return(result);
p += n;
}
if (!first || mins) {
first = 0;
n = snprintf(p, end - p, "%dm", mins);
if (n < 0 || n >= end - p)
return(result);
p += n;
}
snprintf(p, end - p, "%ds", secs);
} else
snprintf(p, end - p, "%lu", (u_long)total);
return(result);
return result;
}
static int