It's a detail but I would update this line like this:

~~~c
if (ob->size) bufputc(ob, '\n');

BUFPUTSL(ob, "<div class=\"footnotes\">\n");
BUFPUTSL(ob, USE_XHTML(options) ? "<hr/>\n" : "<hr>\n");
BUFPUTSL(ob, "<ol>\n");
~~~