aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoshBar <noshbar+git@gmail.com>2019-10-07 23:35:28 +0200
committernoroadsleft <18669334+noroadsleft@users.noreply.github.com>2019-10-07 14:35:28 -0700
commit2c51d1422309d389346022711b4cbc54a8c42f79 (patch)
treebacb06e2442f1024ea5ca75675e7d7b227db1508
parent6bed2394866f0b98ac9b13a82999c875abc9e44a (diff)
downloadqmk_firmware-2c51d1422309d389346022711b4cbc54a8c42f79.tar.gz
qmk_firmware-2c51d1422309d389346022711b4cbc54a8c42f79.zip
[Keyboard] Cannon Keys Satisfaction75: Fix buffer sizes for sprintfs. (#6954)
sprintf always adds a NULL terminator at the end of the buffer it works on. A few places made just enough space for the resulting string, but not the terminator. So this just adds one to the buffer size to make room for it.
-rw-r--r--keyboards/cannonkeys/satisfaction75/satisfaction_oled.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c b/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c
index 4e22587db..6553bd130 100644
--- a/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c
+++ b/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c
@@ -91,8 +91,8 @@ void draw_default(){
91 if (hour == 0){ 91 if (hour == 0){
92 hour = 12; 92 hour = 12;
93 } 93 }
94 char hour_str[2] = ""; 94 char hour_str[3] = "";
95 char min_str[2] = ""; 95 char min_str[3] = "";
96 96
97 sprintf(hour_str, "%02d", hour); 97 sprintf(hour_str, "%02d", hour);
98 sprintf(min_str, "%02d", minute); 98 sprintf(min_str, "%02d", minute);
@@ -199,11 +199,11 @@ void draw_clock(){
199 if (hour == 0){ 199 if (hour == 0){
200 hour = 12; 200 hour = 12;
201 } 201 }
202 char hour_str[2] = ""; 202 char hour_str[3] = "";
203 char min_str[2] = ""; 203 char min_str[3] = "";
204 char year_str[4] = ""; 204 char year_str[5] = "";
205 char month_str[2] = ""; 205 char month_str[3] = "";
206 char day_str[2] = ""; 206 char day_str[3] = "";
207 207
208 sprintf(hour_str, "%02d", hour); 208 sprintf(hour_str, "%02d", hour);
209 sprintf(min_str, "%02d", minute); 209 sprintf(min_str, "%02d", minute);