(process_input): Write terminating \0 for value.