lcw.c: simplify two loops into one.