Skip to content

Commit 04581c8

Browse files
committed
uptime function buffer size fix
1 parent 4b8234b commit 04581c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Commander-API-Commands.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void commander_micros_func( char *args, Stream *response ){
5555

5656
void commander_uptime_func( char *args, Stream *response ){
5757

58-
char buff[ 30 ];
58+
char buff[ 20 ];
5959

6060
int day;
6161
int hour;
@@ -73,7 +73,7 @@ void commander_uptime_func( char *args, Stream *response ){
7373
minute = second / 60;
7474
second %= 60;
7575

76-
snprintf( buff, 30, "%d days, %d:%02d:%02lu", day, hour, minute, second );
76+
snprintf( buff, sizeof( buff ), "%d days, %d:%02d:%02lu", day, hour, minute, second );
7777

7878
response -> print( buff );
7979

0 commit comments

Comments
 (0)