From ff728d43ef5bd4c5e23240fc2eae360cec7b7d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 7 May 2016 17:42:29 +0200 Subject: DB: format sql before calling loadGame(...) --- core/src/ch/asynk/rustanddust/util/DB.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/util/DB.java b/core/src/ch/asynk/rustanddust/util/DB.java index c5c68c3..61e7161 100644 --- a/core/src/ch/asynk/rustanddust/util/DB.java +++ b/core/src/ch/asynk/rustanddust/util/DB.java @@ -349,7 +349,7 @@ public class DB public GameRecord loadGame(int game) { RustAndDust.debug("loadGame"); - return loadGame(game, LOAD_GAME, "loadGAME"); + return loadGame(game, String.format(LOAD_GAME, game), "loadGAME"); } private static final String LOAD_LAST_TURN = "select g._id, g.mode, g.battle, g.opponent, g.turn, g.currentPlayer, g.ts, g.synched" @@ -359,14 +359,14 @@ public class DB public GameRecord loadLastTurn(int game) { RustAndDust.debug("loadLastTurn"); - return loadGame(game, LOAD_LAST_TURN, "loadLastTurn"); + return loadGame(game, String.format(LOAD_LAST_TURN, game), "loadLastTurn"); } private GameRecord loadGame(int game, String sql, String errMsg) { GameRecord r = null; try { - DatabaseCursor cursor = query(String.format(sql, game)); + DatabaseCursor cursor = query(sql); if (cursor.getCount() > 0) { cursor.next(); r = gameRecordFrom(cursor); -- cgit v1.1-2-g2b99