summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2bbe666)
raw | patch | inline | side by side (parent: 2bbe666)
author | Patrick Hallen <patrick.hallen@rwth-aachen.de> | |
Wed, 18 Mar 2009 16:48:20 +0000 (17:48 +0100) | ||
committer | Patrick Hallen <patrick.hallen@rwth-aachen.de> | |
Sat, 28 Mar 2009 18:01:23 +0000 (19:01 +0100) |
src/utils.c | patch | blob | history |
diff --git a/src/utils.c b/src/utils.c
index 32707eb48901ac164ee8d23e4e9fdde377a8c89d..da8fd60aa0527aebbf5594c3ff412bdd3bc09448 100644 (file)
--- a/src/utils.c
+++ b/src/utils.c
duration = g_malloc(length);
iter = duration;
if (time_seconds / 31536000 > 0) {
- if (time_seconds % 31536000 == 1)
- bytes_written = g_snprintf(iter, length, "%lu %s, ", time_seconds / 31536000, year);
+ if (time_seconds / 31536000 == 1)
+ bytes_written = g_snprintf(iter, length, "%d %s, ", 1, year);
else
bytes_written = g_snprintf(iter, length, "%lu %s, ", time_seconds / 31536000, years);
time_seconds %= 31536000;
iter += bytes_written;
}
if (time_seconds / 604800 > 0) {
- if (time_seconds % 604800 == 1)
- bytes_written = g_snprintf(iter, length, "%lu %s, ", time_seconds / 604800, week);
+ if (time_seconds / 604800 == 1)
+ bytes_written = g_snprintf(iter, length, "%d %s, ", 1, week);
else
bytes_written = g_snprintf(iter, length, "%lu %s, ", time_seconds / 604800, weeks);
time_seconds %= 604800;
iter += bytes_written;
}
if (time_seconds / 86400 > 0) {
- if (time_seconds % 86400 == 1)
- bytes_written = g_snprintf(iter, length, "%lu %s, ", time_seconds / 86400, day);
+ if (time_seconds / 86400 == 1)
+ bytes_written = g_snprintf(iter, length, "%d %s, ", 1, day);
else
bytes_written = g_snprintf(iter, length, "%lu %s, ", time_seconds / 86400, days);
time_seconds %= 86400;