Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit 0746eed

Browse files
authored
Merge pull request SHA2017-badge#65 from SHA2017-badge/basvs-nvs-bugfix
tell nvs_get_str() the buffer-length; lower buffer size to 256 bytes
2 parents f875921 + 03f83cb commit 0746eed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

esp32/modbadge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ STATIC mp_obj_t badge_nvs_get_str_(mp_uint_t n_args, const mp_obj_t *args) {
4848
mp_uint_t len;
4949
const char *namespace = mp_obj_str_get_data(args[0], &len);
5050
const char *key = mp_obj_str_get_data(args[1], &len);
51-
char value[1024]; // TODO wut?
52-
size_t length;
51+
char value[256]; // TODO wut?
52+
size_t length = sizeof(value);
5353
esp_err_t err = badge_nvs_get_str(namespace, key, value, &length);
5454
if (err != ESP_OK) {
5555
if (n_args > 2) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy