fix warning of gtk153

This commit is contained in:
daleclack 2023-09-02 22:30:41 +08:00
parent 5301d0d081
commit dd2b0f9a04
1 changed files with 7 additions and 2 deletions

View File

@ -67,7 +67,12 @@ static void my_reminder_init(MyReminder *self)
self->time_label = gtk_label_new(" "); self->time_label = gtk_label_new(" ");
// Get time duration // Get time duration
char time_str[57]; char time_str[120];
// String for timeout
const char *timeout_str = "<span foreground=\"red\" size='16pt'>Time is out!</span>";
// Get days for deadline
int time = get_time_duration(self->year, self->month, self->day); int time = get_time_duration(self->year, self->month, self->day);
if (time >= 0) if (time >= 0)
{ {
@ -77,7 +82,7 @@ static void my_reminder_init(MyReminder *self)
} }
else else
{ {
strncpy(time_str, "<span foreground=\"red\" size='16pt'>Time is out!</span>", 56); strncpy(time_str, timeout_str, strlen(timeout_str));
} }
// Text style of the label // Text style of the label