CID 9835 UNINIT_CTOR - removing leftovers from 12/24 interval option

CID 8960 STRING_OVERFLOW
CID 6788, 6789 SECURE_CODING

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40657 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström
2011-02-24 08:33:35 +00:00
parent c0107fb2bf
commit 1fc4ba42c2
2 changed files with 5 additions and 7 deletions
+5 -6
View File
@@ -80,6 +80,8 @@ TTimeView::TTimeView(float maxWidth, float height, bool showSeconds,
{ {
fTime = fLastTime = time(NULL); fTime = fLastTime = time(NULL);
fSeconds = fMinute = fHour = 0; fSeconds = fMinute = fHour = 0;
fTimeStr[0] = 0;
fDateStr[0] = 0;
fLastTimeStr[0] = 0; fLastTimeStr[0] = 0;
fLastDateStr[0] = 0; fLastDateStr[0] = 0;
fNeedToUpdate = true; fNeedToUpdate = true;
@@ -94,7 +96,6 @@ TTimeView::TTimeView(BMessage* data)
{ {
fTime = fLastTime = time(NULL); fTime = fLastTime = time(NULL);
data->FindBool("seconds", &fShowSeconds); data->FindBool("seconds", &fShowSeconds);
data->FindBool("interval", &fInterval);
fLocale = *BLocale::Default(); fLocale = *BLocale::Default();
} }
@@ -122,7 +123,6 @@ TTimeView::Archive(BMessage* data, bool deep) const
{ {
BView::Archive(data, deep); BView::Archive(data, deep);
data->AddBool("seconds", fShowSeconds); data->AddBool("seconds", fShowSeconds);
data->AddBool("interval", fInterval);
data->AddInt32("deskbar:private_align", B_ALIGN_RIGHT); data->AddInt32("deskbar:private_align", B_ALIGN_RIGHT);
return B_OK; return B_OK;
@@ -268,7 +268,7 @@ TTimeView::GetCurrentDate()
if (str[0] == '0') if (str[0] == '0')
str++; str++;
strcpy(fDateStr, str); strlcpy(fDateStr, str, sizeof(fDateStr));
} }
@@ -329,8 +329,8 @@ TTimeView::Pulse()
|| !fLastTimeStr[0]) || !fLastTimeStr[0])
Update(); Update();
strcpy(fLastTimeStr, fTimeStr); strlcpy(fLastTimeStr, fTimeStr, sizeof(fLastTimeStr));
strcpy(fLastDateStr, fDateStr); strlcpy(fLastDateStr, fDateStr, sizeof(fLastDateStr));
fNeedToUpdate = true; fNeedToUpdate = true;
} }
@@ -338,7 +338,6 @@ TTimeView::Pulse()
fSeconds = ct->tm_sec; fSeconds = ct->tm_sec;
fMinute = ct->tm_min; fMinute = ct->tm_min;
fHour = ct->tm_hour; fHour = ct->tm_hour;
fInterval = ct->tm_hour >= 12;
Draw(Bounds()); Draw(Bounds());
fNeedToUpdate = false; fNeedToUpdate = false;
-1
View File
@@ -103,7 +103,6 @@ class TTimeView : public BView {
int fSeconds; int fSeconds;
int fMinute; int fMinute;
int fHour; int fHour;
bool fInterval;
bool fShowInterval; bool fShowInterval;
bool fShowSeconds; bool fShowSeconds;