myadm

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

commit d949367933abd5db11bee30b14bd8a4b6be4402f
parent b1370f39366481b60a039b585bad94509421d1ac
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Sun, 13 Mar 2016 20:05:50 +0100

Fix itempos().

Diffstat:
Mcore.c | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/core.c b/core.c @@ -354,13 +354,14 @@ getmaxlengths(View *view) { void itempos(const Arg *arg) { - int pos = atoi(stfl_ipool_fromwc(ipool, stfl_get(selview->form, L"pos"))); + const char *spos = stfl_ipool_fromwc(ipool, stfl_get(selview->form, L"pos")); char tmp[8]; + int pos; - if(!selview->nitems) + if(!spos) return; - pos += arg->i; + pos = atoi(spos) + arg->i; if(pos < 0) pos = 0; else if(pos >= selview->nitems) @@ -441,7 +442,7 @@ mysql_listview(MYSQL_RES *res, int showfds) { if(!selview->form) { selview->form = stfl_create(L"<items.stfl>"); - stfl_run(selview->form, -1); + stfl_run(selview->form, -1); /* init ncurses */ curs_set(0); } cleanupitems(&selview->items);