summaryrefslogtreecommitdiff
path: root/net/ocserv/files/patch-src_occtl_time.c
blob: 85ef4c1819ec682f5e180a5637856478df548b6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- src/occtl/time.c.orig	2017-09-09 08:34:02 UTC
+++ src/occtl/time.c
@@ -36,7 +36,7 @@ void print_time_ival7(char output[MAX_TMPSTR_SIZE], ti
 {
 	time_t t = t1 - t2;
 
-	if ((long)t < (long)0) {
+	if ((long long)t < (long long)0) {
 		/* system clock changed? */
 		snprintf(output, MAX_TMPSTR_SIZE, "   ?   ");
 		return;
@@ -44,17 +44,17 @@ void print_time_ival7(char output[MAX_TMPSTR_SIZE], ti
 	
 	if (t >= 48 * 60 * 60)
 		/* 2 days or more */
-		snprintf(output, MAX_TMPSTR_SIZE, _("%2ludays"), (long)t / (24 * 60 * 60));
+		snprintf(output, MAX_TMPSTR_SIZE, _("%2lludays"), (long long)t / (24 * 60 * 60));
 	else if (t >= 60 * 60)
 		/* 1 hour or more */
 	        /* Translation Hint: Hours:Minutes */
-		snprintf(output, MAX_TMPSTR_SIZE, _("%2luh:%02um"), (long)t / (60 * 60),
+		snprintf(output, MAX_TMPSTR_SIZE, _("%2lluh:%02um"), (long long)t / (60 * 60),
 			(unsigned)((t / 60) % 60));
 	else if (t > 60)
 		/* 1 minute or more */
 	        /* Translation Hint: Minutes:Seconds */
-		snprintf(output, MAX_TMPSTR_SIZE, "%2lum:%02us", (long)t / 60, (unsigned)t % 60);
+		snprintf(output, MAX_TMPSTR_SIZE, "%2llum:%02us", (long long)t / 60, (unsigned)t % 60);
 	else
 	        /* Translation Hint: Seconds:Centiseconds */
-		snprintf(output, MAX_TMPSTR_SIZE, _("%5lus"), (long)t);
+		snprintf(output, MAX_TMPSTR_SIZE, _("%5llus"), (long long)t);
 }