pr_time.c (57bd99e61c9500e27d594c06e6ca65367f09157c) pr_time.c (8109e672e42d323d032c8063822997acdc159a24)
1/*-
2 * Copyright (c) 1990, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
36static char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94";
37#endif
38static const char rcsid[] =
1/*-
2 * Copyright (c) 1990, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
36static char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94";
37#endif
38static const char rcsid[] =
39 "$Id: pr_time.c,v 1.9 1997/08/25 06:42:18 charnier Exp $";
39 "$Id: pr_time.c,v 1.10 1997/08/26 06:59:34 charnier Exp $";
40#endif /* not lint */
41
42#include <sys/types.h>
43#include <sys/time.h>
44
45#include <stdio.h>
46#include <string.h>
47

--- 51 unchanged lines hidden (view full) ---

99 (void)printf(" %dday%s ", days, days > 1 ? "s" : " " );
100 if (days >= 10)
101 return(1);
102 }
103
104 /* If idle more than an hour, print as HH:MM. */
105 else if (idle >= 3600)
106 (void)printf(" %2d:%02d ",
40#endif /* not lint */
41
42#include <sys/types.h>
43#include <sys/time.h>
44
45#include <stdio.h>
46#include <string.h>
47

--- 51 unchanged lines hidden (view full) ---

99 (void)printf(" %dday%s ", days, days > 1 ? "s" : " " );
100 if (days >= 10)
101 return(1);
102 }
103
104 /* If idle more than an hour, print as HH:MM. */
105 else if (idle >= 3600)
106 (void)printf(" %2d:%02d ",
107 idle / 3600, (idle % 3600) / 60);
107 (int)(idle / 3600), (int)((idle % 3600) / 60));
108
109 else if (idle / 60 == 0)
110 (void)printf(" - ");
111
112 /* Else print the minutes idle. */
113 else
108
109 else if (idle / 60 == 0)
110 (void)printf(" - ");
111
112 /* Else print the minutes idle. */
113 else
114 (void)printf(" %2d ", idle / 60);
114 (void)printf(" %2d ", (int)(idle / 60));
115
116 return(0); /* not idle longer than 9 days */
117}
115
116 return(0); /* not idle longer than 9 days */
117}