wm_strRemoveCRLF - pointless return value


#1

What is the point of returning a pointer on i[/i] dst?! This provides no information at all!

Surely, a more useful return value would be the number of characters copied; or, perhaps, a pointer to the end of the string copied to dst?


#2

By analogy with UNIX systems – strcpy() and friends return pointer to destination. Same goes for memcpy().

Rudolf


#3

Yes, I realise that - but it is still pointless.

Especially when there are far more useful things that it could return!


#4

Here is a good explanation:
stackoverflow.com/questions/2723 … turn-value

Rudolf


#5

The key phrase there is, “If a function has nothing specific to return”.

My point is that these functions do have much more useful things that they could (and, therefore, should) be refturning.