Patch by Yann Vernier <yann@algonet.se>. From [1]:
wmtv failed to read my .wmtvrc (hand written) correctly, I tracked it
down to incorrect memory management (sizeof() instead of strlen()).
The code was so bad that I chose to rewrite it to a simpler version,
patch below.
Other bugs fixed include some of the memory leaks (which are quite
numerous) and truncating the .wmtvrc when writing to it.
Cosmetic changes include keeping comments in .wmtvrc, C++-style
comments changed to C style, and numbering channels from 1.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=105325