Browse Source

Update Volume String Allocation

[Problem]
Volume string allocates 8 characters but I only need 5.

[Solution]
Only allocate 5 characters for the volume string.

[Testing]
Tested and confirmed working on device.
Gerald McAlister 2 years ago
parent
commit
22aadbc052
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/scenes/settings_scene.c

+ 1 - 1
src/scenes/settings_scene.c

@@ -92,7 +92,7 @@ void scene_on_enter_settings_scene(void* context) {
     variable_item_set_current_value_index(
         item, (uint8_t)(((struct ToneData_t*)app->additionalData)->volume * 10.0f));
 
-    volumeStr = calloc(8, sizeof(char));
+    volumeStr = calloc(5, sizeof(char));
     snprintf(
         volumeStr,
         5,