char *complement (char *set) { int limit = 255; char *table = (char *) malloc((1+limit) * sizeof(char)); /* FIXED */ int i; /* populate table with all non-null characters */ for (i = 0; i < limit; i++) table[i] = i+1; table[limit] = 0; /* for characters in 'set', make their value in the table NULL */ while (*set) table[*set++ - 1] = 0; /* now, swap NULLs in the table with the last element in the table, to condense the table */ for (i = 0; i < limit; i++) if (! table[i]) table[i] = table[--limit], table[limit] = 0; return table; }