It's the only way, how would you ever remember what charactor you swaped out to begin with ?? Besides a single char isn't allocating extra space, on the other hand something like:
Code:
char * res_str = (char*) malloc(strlen(orig_str)*sizeof(char));
/* or */
char res_str[strlen(orig_str)];
would be allocating extra buffer space...