Skip to content

Commit

Permalink
Adjusted date allocation size and used snprintf instead
Browse files Browse the repository at this point in the history
  • Loading branch information
maodus committed Jul 6, 2024
1 parent 2f84f1b commit 622e13d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extras/menus/arkMenu/src/system_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ static void drawDateTime() {
pspTime date;
sceRtcGetCurrentClockLocalTime(&date);

char dateStr[100];
sprintf(dateStr, "%04d/%02d/%02d %02d:%02d:%02d", date.year, date.month, date.day, date.hour, date.minutes, date.seconds);
char dateStr[20];
snprintf(dateStr, 20, "%04d/%02d/%02d %02d:%02d:%02d", date.year, date.month, date.day, date.hour, date.minutes, date.seconds);

This comment has been minimized.

Copy link
@krazynez

krazynez Jul 6, 2024

Collaborator

Your drunk go home: sizeof(dateStr)+1 or strlen(dateStr)

int x = 445 - common::calcTextWidth(dateStr, SIZE_MEDIUM, 0);
if (common::getConf()->battery_percent) x -= common::calcTextWidth("-100%", SIZE_MEDIUM, 0);
common::printText(x, 13, dateStr, LITEGRAY, SIZE_MEDIUM, 0, 0, 0);
Expand Down

0 comments on commit 622e13d

Please sign in to comment.