It should only be 0-35 since your array has 36 elements and you can access them with 0..35. Accessing with an index of 36 gives you the non-existant 37th element.
As for the string always being terminated, just terminate after every new addition
InputArray[InputArrayPos++] = charselect;
InputArray[InputArrayPos] = '\0';
And you really should put in same checking to keep is inside your buffer size.