An implementation of djb's redo in C