A better way to handle this might be to check the prototype of 'write_command' - it should probably be taking a 'const char *' rather than a 'char *' (write_command doesn't modify the parameter its passed).