diff options
author | sr161167 <none@none> | 2006-03-28 20:56:44 -0800 |
---|---|---|
committer | sr161167 <none@none> | 2006-03-28 20:56:44 -0800 |
commit | 1337fffa3690437b89871837ee0ccf7d2f44fae3 (patch) | |
tree | 4b3cddbd913287283982af301b84b6e57749c2fc /usr/src/cmd/sa | |
parent | 685482d6dae8b0c167f468d6313a738ae17c592c (diff) | |
download | illumos-gate-1337fffa3690437b89871837ee0ccf7d2f44fae3.tar.gz |
6325270 "timex" outputs garbled characters with large HZ.
6384545 "timex" omits the most significant digit in the hour information.
Diffstat (limited to 'usr/src/cmd/sa')
-rw-r--r-- | usr/src/cmd/sa/timex.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/usr/src/cmd/sa/timex.c b/usr/src/cmd/sa/timex.c index d31f514418..027aca7bee 100644 --- a/usr/src/cmd/sa/timex.c +++ b/usr/src/cmd/sa/timex.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,10 +18,12 @@ * * CDDL HEADER END */ + /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -47,7 +48,7 @@ char fname[20]; /* * Quant[0] will get set to HZ/10 later. */ -char quant[] = { 10, 10, 10, 6, 10, 6, 10, 10, 10 }; +int quant[] = { 10, 10, 10, 6, 10, 6, 10, 10, 10, 10, 10 }; void printt(char *, time_t); void hmstime(char[]); @@ -193,19 +194,19 @@ main(int argc, char **argv) exit(status>>8); } -char *pad = "000 "; +char *pad = "000 "; char *sep = "\0\0.\0:\0:\0\0"; char *nsep = "\0\0.\0 \0 \0\0"; void printt(char *s, time_t a) { - char digit[9]; + int digit[11]; int i; char c; int nonzero; - for (i = 0; i < 9; i++) { + for (i = 0; i < 11; i++) { digit[i] = a % quant[i]; a /= quant[i]; } |