3 ms·
Obviously strcpy is dangerous, that's why I copy all my strings by hand with: while(*dest++ = *src++);
by skywhopper 13y ago
Obviously strcpy is dangerous, that's why I copy all my strings by hand with:
while(*dest++ = *src++);
- delinka 13y agoI really hope this was sarcasm. But if not... There's nothing here to prevent a buffer overrun. If your src doesn't end in 0, or your dest is too small, you'll be reading memory you shouldn't and/or obliterating memory past your dest buffer. Your method is pretty much on par with an inlined strcpy.
- angersock 13y agoI don't always copy strings, but when I d8$#@C11&C^C^CSegmentation Fault