Code:
char input[inplen];
This statement (as well as declarations in the body of the code) will work only with compilers that are C99 compliant in those regards, which makes your code not very portable.