fix off-by-one error when adding user mirrors to an existing repo

This commit is contained in:
Hans-Christoph Steiner 2018-06-21 13:48:26 +02:00
parent 90748a3685
commit 1a7c73064f

View File

@ -785,7 +785,7 @@ public class ManageReposActivity extends AppCompatActivity
repo.userMirrors = new String[]{url};
} else {
int last = repo.userMirrors.length;
repo.userMirrors = Arrays.copyOf(repo.userMirrors, last);
repo.userMirrors = Arrays.copyOf(repo.userMirrors, last + 1);
repo.userMirrors[last] = url;
}
values.put(RepoTable.Cols.USER_MIRRORS, Utils.serializeCommaSeparatedString(repo.userMirrors));