From 965cfe40086df3274e8228a526a624b96bfc5e03 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 21 Sep 2006 11:42:44 +0000 Subject: Fix bug #1562795: "Bug with auto-generated game IDs" svn-id: r23960 --- gui/launcher.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gui') diff --git a/gui/launcher.cpp b/gui/launcher.cpp index a41615668c..eadd2ab78c 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -649,13 +649,13 @@ void LauncherDialog::addGame() { // are *adding* a game to the config, not replacing). String domain(result.gameid); if (ConfMan.hasGameDomain(domain)) { - char suffix = 'a'; - domain += suffix; + int suffixN = 1; + char suffix[16]; + while (ConfMan.hasGameDomain(domain)) { - assert(suffix < 'z'); - domain.deleteLastChar(); - suffix++; - domain += suffix; + snprintf(suffix, 16, "-%d", suffixN); + domain = result.gameid + suffix; + suffixN++; } } -- cgit v1.2.3