Formatting all link output

It would print all of them in the same line before; not anymore.
Also, why do I still keep ftruncate there?