myadm

Simple MySQL client for the terminal
git clone git://git.bitsmanent.org/myadm
Log | Files | Refs | README | LICENSE

commit b9f9a54094231fb3b90bc548fd5e40de11bec1a6
parent 9c60b6286fe1f0b58671f791d17ad320d121f3b3
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Mon, 25 Apr 2016 15:34:01 +0200

Fix sql size in mksql_update_record().

Diffstat:
Mmyadm.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/myadm.c b/myadm.c @@ -474,7 +474,7 @@ mksql_update_record(Item *item, Field *fields, char *tbl, char *pk) { if(nq) free(col); } - size += 29; + size = 28 + cnt + strlen(pk) + strlen(pkv) + strlen(tbl); sql = ecalloc(1, size); snprintf(sql, size, "UPDATE `%s` SET%s\nWHERE `%s` = '%s'", tbl, sqlfds, pk, pkv); free(sqlfds);