From b901ec271519d8cb2ffd230381bab018f7ae23f5 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Tue, 21 Nov 2006 21:05:35 +0000 Subject: [PATCH] Stop generating "xxxx, 0 second" uptime string. How smallish and useless contribution I could do... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19352 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/abouthaiku/AboutHaiku.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/apps/abouthaiku/AboutHaiku.cpp b/src/apps/abouthaiku/AboutHaiku.cpp index c299d714bd..393b0bcc44 100644 --- a/src/apps/abouthaiku/AboutHaiku.cpp +++ b/src/apps/abouthaiku/AboutHaiku.cpp @@ -598,10 +598,14 @@ UptimeToString(char string[], size_t size) str != string ? ", " : "", minutes, minutes > 1 ? "s" : ""); } - // Always show second(s)... - str += snprintf(str, size - strlen(string), "%s%lld second%s", + + if (seconds || str == string) { + // Haiku would be well-known to boot very fast. + // Let's be ready to handle below minute uptime, zero second included ;-) + str += snprintf(str, size - strlen(string), "%s%lld second%s", str != string ? ", " : "", seconds, seconds > 1 ? "s" : ""); + } return string; }