#define BUTTON_TEXT_SIZE 512
#define WEEK_BUTTON_SIZE 80
#define DAY_MAX_LENGTH 80
-#define WEEK_MAX_STRING DAY_MAX_LENGTH * 7
+#define DAYS_IN_WEEK 7
+#define NUMBER_OF_SPACES 6
+#define WEEK_MAX_STRING DAY_MAX_LENGTH * DAYS_IN_WEEK + NUMBER_OF_SPACES + 1
#define GREEN_TEXT_COLOR "<font_size=80><color=#b3b3b3>%s</color></font_size>"
#define GREY_TEXT_COLOR "<font_size=80><color=#97e57b>%s</color></font_size>"
else
snprintf(formattedDay, DAY_MAX_LENGTH, GREY_TEXT_MAIN, text);
- strncat(outBuf, formattedDay, DAY_MAX_LENGTH);
+ strncat(outBuf, formattedDay, WEEK_MAX_STRING - strlen(outBuf) - 1);
+ if(week_day != DND_SCHEDULE_WEEK_FLAG_SUNDAY)
+ strncat(outBuf, " ", WEEK_MAX_STRING - strlen(outBuf) - 1);
}
int load_dnd_schedule_day()
buff[0] = 0;
make_color_text(dnd_schedule, DND_SCHEDULE_WEEK_FLAG_MONDAY, APP_STRING("WDS_ALM_BUTTON_M_M_MONDAY_ABB"), buff);
- strncat(buff, " ", WEEK_MAX_STRING);
make_color_text(dnd_schedule, DND_SCHEDULE_WEEK_FLAG_TUESDAY, APP_STRING("WDS_ALM_BUTTON_T_M_TUESDAY_ABB"), buff);
- strncat(buff, " ", WEEK_MAX_STRING);
make_color_text(dnd_schedule, DND_SCHEDULE_WEEK_FLAG_WEDNESDAY, APP_STRING("WDS_ALM_BUTTON_W_M_WEDNESDAY_ABB"), buff);
- strncat(buff, " ", WEEK_MAX_STRING);
make_color_text(dnd_schedule, DND_SCHEDULE_WEEK_FLAG_THURSDAY, APP_STRING("WDS_ALM_BUTTON_T_M_THURSDAY_ABB"), buff);
- strncat(buff, " ", WEEK_MAX_STRING);
make_color_text(dnd_schedule, DND_SCHEDULE_WEEK_FLAG_FRIDAY, APP_STRING("WDS_ALM_BUTTON_F_M_FRIDAY_ABB"), buff);
- strncat(buff, " ", WEEK_MAX_STRING);
make_color_text(dnd_schedule, DND_SCHEDULE_WEEK_FLAG_SATURDAY, APP_STRING("WDS_ALM_BUTTON_S_M_SATURDAY_ABB"), buff);
- strncat(buff, " ", WEEK_MAX_STRING);
make_color_text(dnd_schedule, DND_SCHEDULE_WEEK_FLAG_SUNDAY, APP_STRING("WDS_ALM_BUTTON_S_M_SUNDAY_ABB"), buff);
return buff;
}