myadm

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

commit 69ee47b30861a98b236e6da08bad7d5b2773d2f6
parent e28d93535f67c37e322845bf7a9e2b5c74877060
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Thu, 24 Mar 2016 22:11:00 +0100

Fix a bug in records().

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

diff --git a/myadm.c b/myadm.c @@ -529,7 +529,8 @@ records(const Arg *arg) { } if(!selview->choice->ncols) die("records: no choice.\n"); - tbl = selview->choice->cols[0]; + tbl = ecalloc(1 + selview->choice->lens[0], sizeof(char)); + snprintf(tbl, 1 + selview->choice->lens[0], "%s", selview->choice->cols[0]); if(!(res = mysql_exec("select * from `%s`", tbl))) die("records: cannot select `%s`\n", tbl); mysql_fillview(res, 1);