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
This commit is contained in:
Philippe Houdoin 2006-11-21 21:05:35 +00:00
parent 464cd15f0a
commit b901ec2715
1 changed files with 6 additions and 2 deletions

View File

@ -598,10 +598,14 @@ UptimeToString(char string[], size_t size)
str != string ? ", " : "", str != string ? ", " : "",
minutes, minutes > 1 ? "s" : ""); 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 ? ", " : "", str != string ? ", " : "",
seconds, seconds > 1 ? "s" : ""); seconds, seconds > 1 ? "s" : "");
}
return string; return string;
} }