Observed in all versions I've tried, from 1.0.27 thru 1.0.30
Once vncviewer is running, pressing F8 and setting -scale to either 'fit' or 'auto' work as expected. However, if specified at invocation, whether by command line argument or environment variable or profile, both options throw an error (invalid scale factor) and the result is a null (1x1) window. If -geometry is specified on the command line, the window is sized accordingly, but neither auto or fit scaling is applied.
In looking through desktop.c (and I'll qualify this by stating I'm only marginally familiar with C and not at all with the X internals) it seems the problem is that when appData.scale is initially being queried and the scale factors established, there is no window size yet established. Therefore, the auto and fit options have nothing to create the relative scaling factors from, and that results in them being set to NULL. Hence, the null window that results.
I've tested this theory by hacking desktop.c get_scale_values() and inserting literal values, and it appears I'm on the right track. I don't have the X knowledge, however, to devise the fix.
It seems the auto and fit logic needs to be adjusted, during initial setup at least (as runtime changes appear to work fine) to look at the window (-geometry) size (for auto) and desktop size (for fit) and to use those to determine the initial scale factors. This could be implemented through logic (are the sizes returned rational?) or perhaps more simply via a isRunning or isStartup flag to alter the first time setup logic.
This patch fixes the problem.