3 ms·
This construct: while(*p++ = *q++); is simple. But I agree with you, its time has long gone, because in many programs, this code is also wrong. This idi
by dwheeler 7y ago
This construct:
while(*p++ = *q++);
is simple. But I agree with you, its time has long gone, because in many programs, this code is also wrong. This idiom assumes that that the source can never be longer than the destination. There are now a legion of attackers who will exploit this code and harm its users.
Modern C programs often have to work in the presence of attackers.