Reimplement, handling the case where c == L'\0' correctly and fixing some style(9) bugs.
Reimplement, handling the case where c == L'\0' correctly and fixing
some style(9) bugs.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase