Strings overlap eachother.
#7

This is a really dangerous function because it has no out-of-bounds checking whatsoever. The max length to copy should be the size of the destination, not the size of the source. But yeah, if you just want to copy strings use the proven method because this still seems really crappy (sorry). You may still use your own function to copy arrays.

PHP код:
strcpy(dest[], const source[], maxlength sizeof dest)
    return 
strcat((dest[0] = EOSdest), sourcemaxlength); 
Reply


Messages In This Thread
Strings overlap eachother. - by justinnater - 11.12.2015, 13:39
Re: Strings overlap eachother. - by vassilis - 11.12.2015, 13:42
Re: Strings overlap eachother. - by justinnater - 11.12.2015, 13:44
Re: Strings overlap eachother. - by vassilis - 11.12.2015, 13:48
Re: Strings overlap eachother. - by justinnater - 11.12.2015, 13:55
Re: Strings overlap eachother. - by vassilis - 11.12.2015, 14:28
Re: Strings overlap eachother. - by Vince - 11.12.2015, 14:43
Re: Strings overlap eachother. - by vassilis - 11.12.2015, 14:45
Re: Strings overlap eachother. - by SickAttack - 11.12.2015, 14:52
Re: Strings overlap eachother. - by justinnater - 11.12.2015, 14:53

Forum Jump:


Users browsing this thread: 4 Guest(s)