In a non-volatile memory programming scheme where the memory cells are
programmed in two or more sequential programming passes, when there is
insufficient host data to program at least some of the memory cells
during the second pass, some of the memory cells may be programmed to the
wrong threshold voltage. This can be prevented by modifying the
programming scheme so that this does not occur. In one implementation,
this is accomplished by choosing a code scheme, which does not cause the
memory cells to be programmed to the wrong threshold voltage during the
second programming pass, or by programming the memory cells in accordance
with substitute data that would not cause the cells to be programmed to
an erroneous state.