If I understand this code correctly:

Let's assume `saveDataListCount` is 10.  Let's assume that the directory at `savePath` has 20 subdirectories, all of which start with `gameName`.

Let's further assume each entry in `saveDataList` is `<>`.  This would be for example the case in FF4 iirc.

At entry #1, we will see "<>" and enter the branch.  We will list the 20 subdirectories into `allSaves`.

For each of these 20 items, we will verify they start with `gameName`, and then check if they exist (of course they exist, we listed them.)  Since they exist, we will increase realCount for each one.

At the end of this loop, `realCount` will be 20.  That was for item #1.  `SetFileInfo()` includes this code `saveDataList[idx].idx = idx;`, so so far we have overflowed the buffer by 10 items.

We continue.  Now we are at item 2.  It is also `<>`.  We again list the 20 items, and now we have overflowed the buffer by 30.

At the end of this outer loop, we will have overflowed the buffer by 90.

-[Unknown]