SQLite Forum

a probable bug in .output handler
Login
In the handler for .output, .once and .excel commands, (in today's 202004221349.tar.gz preview and also at line 8349 in shell.c.in), a local variable bOnce is introduced, without initialization.  It appears that when the .output command is handled by this code, bOnce remains uninitialized until its first use at line 8385 in a conditional.  The MSVC v19 compiler warns of this, and I think it is right to do so. I think the code is bound to fail for the .output command whenever the stack does not happen to contain 0 where bOnce is allocated.

I have to say that this code is immensely more readable than before. I doubt I would be able to make this claim of incorrectness before, at least not without a lot more study.