Do I need to treat cases when I actully have nothing to move/copy with memmove()
/memcpy()
as edge cases
int numberOfBytes = ...
if( numberOfBytes != 0 ) {
memmove( dest, source, numberOfBytes );
}
or should I just call the function without checking
int numberOfBytes = ...
memmove( dest, source, numberOfBytes );
Is the check in the former snippet necessary?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…