Skip to content

Commit 4b8234b

Browse files
committed
uptime command buffer size fix.
1 parent dd5cb78 commit 4b8234b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/Commander_Shellminator_Advanced_Telnet_ESP32/Commander_Shellminator_Advanced_Telnet_ESP32.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#define SERVER_PORT 23
2323

2424
// WiFi credentials.
25-
const char* ssid = "WiFI-SSID";
26-
const char* password = "WiFi-PASS";
25+
const char* ssid = "your-wifi-ssid";
26+
const char* password = "your-wifi-pass";
2727

2828
// Create an instance of the server.
2929
// It will be available on port 23.

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[ 20 ];
58+
char buff[ 30 ];
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-
sprintf( buff, "%d days, %d:%02d:%02lu", day, hour, minute, second );
76+
snprintf( buff, 30, "%d days, %d:%02d:%02lu", day, hour, minute, second );
7777

7878
response -> print( buff );
7979

0 commit comments

Comments
 (0)