The issue seems to be around the function static void eat_whitespace(void) in indent.c. If that function is emptied by commenting out its contents, the issue does not appear:
$ ./xmlindent ../a.xml <test> <test2>a bc</test2> </test> -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org