Patch by Rene Gollent which fixes displaying of current time. I've used
snprintf instead of sprintf and reduced the size of the char array, though. Hope you don't mind, Rene. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22406 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "TZDisplay.h"
|
||||
|
||||
|
||||
@@ -125,8 +127,10 @@ TTZDisplay::SetTime(int32 hour, int32 minute)
|
||||
if (hour > 11)
|
||||
ap = "PM";
|
||||
|
||||
fTime.SetTo("");
|
||||
fTime << ahour << ":" << minute << ":" << ap;
|
||||
char buffer[32];
|
||||
snprintf(buffer, sizeof(buffer), "%ld:%02ld %s", ahour, minute, ap);
|
||||
|
||||
fTime.SetTo(buffer);
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user