comparison src/util.c @ 1376:730a1a19b4cc

[gaim-migrate @ 1386] yay, no more negative online times. also no more correction_time. i hope this doesn't break things. it shoudln't, right? oh well. um. since there's no more correction_time there's no more reason to force ourselves as a buddy (right?), so that also fixes the problem of yahoo forcing you to have yourself as a buddy. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 04 Jan 2001 22:58:08 +0000
parents fbc0cbf24a62
children 5c67b8794991
comparison
equal deleted inserted replaced
1375:b167222b5c93 1376:730a1a19b4cc
31 #include <sys/stat.h> 31 #include <sys/stat.h>
32 #include <string.h> 32 #include <string.h>
33 #include <sys/wait.h> 33 #include <sys/wait.h>
34 #include <gtk/gtk.h> 34 #include <gtk/gtk.h>
35 #include <ctype.h> 35 #include <ctype.h>
36 #include <math.h>
36 #include <pixmaps/aimicon.xpm> 37 #include <pixmaps/aimicon.xpm>
37 #include "gaim.h" 38 #include "gaim.h"
38 39
39 static GdkPixmap *icon_pm = NULL; 40 static GdkPixmap *icon_pm = NULL;
40 static GdkBitmap *icon_bm = NULL; 41 static GdkBitmap *icon_bm = NULL;
66 return 0; 67 return 0;
67 } 68 }
68 } 69 }
69 70
70 71
71 gchar *sec_to_text(gint sec) 72 gchar *sec_to_text(guint sec)
72 { 73 {
73 int hrs, min; 74 int hrs, min;
74 char minutes[64]; 75 char minutes[64];
75 char hours[64]; 76 char hours[64];
76 char *sep; 77 char *sep;
84 85
85 if (min) { 86 if (min) {
86 if (min == 1) 87 if (min == 1)
87 g_snprintf(minutes, sizeof(minutes), "%d minute.", min); 88 g_snprintf(minutes, sizeof(minutes), "%d minute.", min);
88 else 89 else
89 g_snprintf(minutes, sizeof(minutes), "%d minutes.", min); 90 g_snprintf(minutes, sizeof(minutes), "%d minutes.", abs(min));
90 sep = ", "; 91 sep = ", ";
91 } else { 92 } else {
92 if (!hrs) 93 if (!hrs)
93 g_snprintf(minutes, sizeof(minutes), "%d minutes.", min); 94 g_snprintf(minutes, sizeof(minutes), "%d minutes.", abs(min));
94 else { 95 else {
95 minutes[0] = '.'; 96 minutes[0] = '.';
96 minutes[1] = '\0'; 97 minutes[1] = '\0';
97 } 98 }
98 sep = ""; 99 sep = "";
100 101
101 if (hrs) { 102 if (hrs) {
102 if (hrs == 1) 103 if (hrs == 1)
103 g_snprintf(hours, sizeof(hours), "%d hour%s", hrs, sep); 104 g_snprintf(hours, sizeof(hours), "%d hour%s", hrs, sep);
104 else 105 else
105 g_snprintf(hours, sizeof(hours), "%d hours%s", hrs, sep); 106 g_snprintf(hours, sizeof(hours), "%d hours%s", abs(hrs), sep);
106 } else 107 } else
107 hours[0] = '\0'; 108 hours[0] = '\0';
108 109
109 110
110 g_snprintf(ret, 256, "%s%s", hours, minutes); 111 g_snprintf(ret, 256, "%s%s", hours, minutes);