diff options
author | Sebastian Reichel <sre@ring0.de> | 2012-05-24 17:12:10 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2012-05-24 17:12:10 +0200 |
commit | 9460b224e20d8da2ef99fb86b9206e5c21761a55 (patch) | |
tree | d7f7bd1d0ecbf78d680db6a3044a9b9b4e503ad2 | |
parent | 88fb14a49730ab30eb1579f0491a55389931b91d (diff) | |
download | serial-barcode-scanner-9460b224e20d8da2ef99fb86b9206e5c21761a55.tar.bz2 |
fix %llu/%lld for user id (should be %d)
-rw-r--r-- | db.vala | 10 | ||||
-rw-r--r-- | main.vala | 4 |
2 files changed, 7 insertions, 7 deletions
@@ -90,7 +90,7 @@ public class Database { int64 timestamp = (new DateTime.now_utc()).to_unix(); this.purchase_stmt1.reset(); - this.purchase_stmt1.bind_text(1, "%lld".printf(user)); + this.purchase_stmt1.bind_text(1, "%d".printf(user)); this.purchase_stmt1.bind_text(2, "%llu".printf(article)); this.purchase_stmt1.bind_text(3, "%llu".printf(timestamp)); @@ -133,7 +133,7 @@ public class Database { int rc = 0; this.undo_stmt1.reset(); - this.undo_stmt1.bind_text(1, "%llu".printf(user)); + this.undo_stmt1.bind_text(1, "%d".printf(user)); rc = this.undo_stmt1.step(); switch(rc) { @@ -141,14 +141,14 @@ public class Database { pid = uint64.parse(this.undo_stmt1.column_text(0)); break; case Sqlite.DONE: - stdout.printf("undo not possible without purchases"); + stdout.printf("undo not possible without purchases\n"); return false; default: error("[interner Fehler: %d]".printf(rc)); } this.undo_stmt2.reset(); - this.undo_stmt2.bind_text(1, "%llu".printf(user)); + this.undo_stmt2.bind_text(1, "%d".printf(user)); rc = this.undo_stmt2.step(); if(rc != Sqlite.DONE) @@ -181,7 +181,7 @@ public class Database { int64 timestamp = (new DateTime.now_utc()).to_unix(); this.stock_stmt1.reset(); - this.stock_stmt1.bind_text(1, "%llu".printf(user)); + this.stock_stmt1.bind_text(1, "%d".printf(user)); this.stock_stmt1.bind_text(2, "%llu".printf(product)); this.stock_stmt1.bind_text(3, "%llu".printf(amount)); this.stock_stmt1.bind_text(4, "%llu".printf(timestamp)); @@ -25,7 +25,7 @@ public static bool interpret(string data) { int32 id = int.parse(str_id); /* check if data has valid format */ - if(data != "USER %lld".printf(id)) { + if(data != "USER %d".printf(id)) { stdout.printf("[%lld] ungültige Benutzernummer: %s\n", timestamp, data); return false; } @@ -35,7 +35,7 @@ public static bool interpret(string data) { db.logout(); } - stdout.printf("[%lld] Login: %lld\n", timestamp, id); + stdout.printf("[%lld] Login: %d\n", timestamp, id); return db.login(id); } else if(data == "GUEST") { if(db.is_logged_in()) { |