Fix xdump updates not to dump bogus extra updates

"xdump updates" believes there are always 15 (UPDATE_TIME_LEN - 1)
scheduled updates.  When fewer than 15 updates are scheduled, it shows
whatever crap update time happens to be in the unused part of
update_time[]: the initial zero or a previously scheduled update.

Root cause is that table EF_UPDATES has always UPDATE_TIME_LEN - 1
entries, which is incorrect when fewer updates are scheduled.  Only
xdump is affected, as the other users ignore the length and stop at
the sentinel.

Fix update_get_schedule() to resize table EF_UPDATES.
This commit is contained in:
Markus Armbruster 2011-04-30 07:35:14 +02:00
parent 5b9d31a4b3
commit 573d3fe870
2 changed files with 10 additions and 4 deletions

View file

@ -186,7 +186,7 @@ struct empfile empfile[] = {
* Update schedule table. Use read_schedule() to fill.
*/
{EF_UPDATES, "updates", NULL, update_ca,
ARRAY_TABLE(update_time, EFF_CFG)},
ARRAY_CACHE(update_time, EFF_CFG)},
/*
* Special tables. EF_META gets bogus size, cids and fids here.
* Fixed up by empfile_init(). EF_VERSION's cadef is set by