- did not work for modes yet
- crashes afer some while ...
[r8420]
for (i = 0, entry = pset_first(status->pattern_hash);
entry && i < count;
entry = pset_next(status->pattern_hash), ++i) {
for (i = 0, entry = pset_first(status->pattern_hash);
entry && i < count;
entry = pset_next(status->pattern_hash), ++i) {
- fwrite(entry, sizeof(*entry) + (entry->len - 1), 1, f);
+ fwrite(entry, offsetof(pattern_entry_t, buf) + entry->len, 1, f);
/* read all pattern entries and put them into the hash table. */
for (i = 0; i < count; ++i) {
init_buf(&buf, buffer, sizeof(buffer));
/* read all pattern entries and put them into the hash table. */
for (i = 0; i < count; ++i) {
init_buf(&buf, buffer, sizeof(buffer));
- fread(&tmp, sizeof(tmp), 1, f);
- put_byte(&buf, tmp.buf[0]);
- for (j = 1; j < tmp.len; ++j)
+ fread(&tmp, offsetof(pattern_entry_t, buf), 1, f);
+ for (j = 0; j < tmp.len; ++j)
put_byte(&buf, fgetc(f));
entry = pattern_get_entry(&buf, pattern_hash);
memcpy(&entry->count, &tmp.count, sizeof(entry->count));
put_byte(&buf, fgetc(f));
entry = pattern_get_entry(&buf, pattern_hash);
memcpy(&entry->count, &tmp.count, sizeof(entry->count));
return;
status->bound = 10;
return;
status->bound = 10;
- status->options = OPT_WITH_MODE | OPT_ENC_DAG | OPT_WITH_ICONST | OPT_PERSIST_PATTERN;
+ status->options = /* OPT_WITH_MODE | */ OPT_ENC_DAG | OPT_WITH_ICONST | OPT_PERSIST_PATTERN;
obstack_init(&status->obst);
obstack_init(&status->obst);