fix left-substitutions in comparisons

The 'inner index' when using g_index in a comparison
comparing two literals casted the ulong g_index to
a uint, resulting in incorrect vprintf'ing.