summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2019-07-20 17:11:32 +0200
committerFrank Gevaerts <frank@gevaerts.be>2019-07-20 17:11:32 +0200
commit3665eecf473b8ea62dc26db2718952c4ddf6cdfc (patch)
tree225b15bbe5e71cad8cb95882a1b8cb592f82fce5 /apps
parent3cb272c97a23f6b28a60201614f38fd1a566de08 (diff)
downloadrockbox-3665eecf473b8ea62dc26db2718952c4ddf6cdfc.tar.gz
rockbox-3665eecf473b8ea62dc26db2718952c4ddf6cdfc.zip
Increase set_time_screen() buffer size for hosted to keep the compiler happy.
The format strings in the snprintf can in theory need 60 characters This will not happen in practice (because seconds are 0..60 and not full-range integers etc.), but -D_FORTIFY_SOURCE will still warn about it, so we use 60 characters for HOSTED to make the compiler happy. Native builds still use 20, which is enough in practice. Change-Id: I22a2bab8134442e531a10bf883f3a369ade0fdc3
Diffstat (limited to 'apps')
-rw-r--r--apps/screens.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/screens.c b/apps/screens.c
index db83a9837d..9cb5ebe258 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -374,7 +374,16 @@ bool set_time_screen(const char* title, struct tm *tm)
374 int button; 374 int button;
375 unsigned int i, realyear, min, max; 375 unsigned int i, realyear, min, max;
376 unsigned char *ptr[6]; 376 unsigned char *ptr[6];
377#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
378 /* The format strings in the snprintf can in theory need 60 characters
379 This will not happen in practice (because seconds are 0..60 and not
380 full-range integers etc.), but -D_FORTIFY_SOURCE will still warn
381 about it, so we use 60 characters for HOSTED to make the compiler
382 happy. Native builds still use 20, which is enough in practice. */
383 unsigned char buffer[60];
384#else
377 unsigned char buffer[20]; 385 unsigned char buffer[20];
386#endif
378 int *valptr = NULL; 387 int *valptr = NULL;
379 static unsigned char daysinmonth[] = 388 static unsigned char daysinmonth[] =
380 {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 389 {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};