Mail Archives: djgpp/1998/07/22/13:51:30
Eli Zaretskii wrote:
>
> I think this should be faster:
>
> int strcopnb( char *dest, char *org, int max )
> {
> int i;
>
> memcpy( dest,org,max );
> dest[max] = '\0';
> /* max = strlen( dest ); redundant: we just put '\0' at dest[max] */
> for( i=max-1; i >= 0 && dest[i] == ' '; i-- );
> dest[i+1] = '\0';
> return 0;
> }
>
Yes, but it's buggy when strlen(org) is less than max.
> This thread is quickly degenerating into a C optimization class ;-).
I apreciate a lot your advices and I like write about, but I think the
very important thing is the big perfomance of DJGPP v2.02 whith lan
data-base applications. I encourage any people whit a data-base app to
test 2.02.
Regards, M.Alvarez
- Raw text -