implement ucpcal_readline
remove snprintf as it's not needed or available in C89