in reply to Golf: string complement
which stomps on the memory location just after the end of the array. The bug would be fixed by mallocing an extra element:table[limit] = 0;
Happily, Perl does not have these sorts of problems.char *table = (char *) malloc( (limit + 1) * sizeof(char) );
-Mark
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Golf: string complement
by japhy (Canon) on May 15, 2004 at 16:08 UTC |