all repos — mgba @ 63197308b659349a3e9ce2317b2dc581dace79cd

mGBA Game Boy Advance Emulator

Core: Fix maximum length of INI section names

It was a generous 128, but the inih library has its own maximum length
of 50.  Any longer keys were truncated by inih, so they appeared to be
missing when mgba tried to read the longer key again later.

This was causing the configuration for my Nintendo Wii Remote Pro
Controller to be effectively lost; the key name ended up at 53
characters.

Arguably inih should truncate when reading, too, but...
Eevee (Lexy Munroe) eevee.git@veekun.com
Fri, 05 May 2017 19:08:46 -0700
commit

63197308b659349a3e9ce2317b2dc581dace79cd

parent

e1b681f6036706a402f5ab581b61a0f9dcc354ec

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/core/input.csrc/core/input.c

@@ -11,7 +11,7 @@ #include <mgba-util/vector.h>

#include <inttypes.h> -#define SECTION_NAME_MAX 128 +#define SECTION_NAME_MAX 50 #define KEY_NAME_MAX 32 #define KEY_VALUE_MAX 16 #define AXIS_INFO_MAX 12