# HG changeset patch # User Mike Becker # Date 1429603897 -7200 # Node ID 53fd8595378c00a11797b3ecec5d3e809d252308 # Parent 05c3c6842aef5d414aaec0d45329e5c501ed045e added links for line numbers diff -r 05c3c6842aef -r 53fd8595378c src/c2html.c --- a/src/c2html.c Tue Apr 21 09:53:01 2015 +0200 +++ b/src/c2html.c Tue Apr 21 10:11:37 2015 +0200 @@ -168,10 +168,16 @@ // write line number if (showln) { WRITECONST(stream, out, ""); - char lnbuf[16]; - int len = snprintf(lnbuf, 16, "%*d ", lnw, i+1); + char lnbuf[128]; + int len; + // line number link + len = snprintf(lnbuf, 128, "", + i+1, i+1); out(lnbuf, 1, len, stream); - WRITECONST(stream, out, " "); + // justified line number + len = snprintf(lnbuf, 128, "%*d ", lnw, i+1); + out(lnbuf, 1, len, stream); + WRITECONST(stream, out, " "); } // write formated (or plain) code line diff -r 05c3c6842aef -r 53fd8595378c test/header.html --- a/test/header.html Tue Apr 21 09:53:01 2015 +0200 +++ b/test/header.html Tue Apr 21 10:11:37 2015 +0200 @@ -3,8 +3,9 @@ c2html