diff --git a/src/ChangeLog b/src/ChangeLog index 53c4b552e..d2fce013f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-09-12 Pavel Roskin + + * chmod.c (chmod_callback): Fix uninitialized variable. + 2003-09-11 Pavel Roskin * main.c (midnight_callback): Don't redraw dirty panels if the diff --git a/src/chmod.c b/src/chmod.c index 09b3caa3e..4e7c72405 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -151,12 +151,10 @@ static cb_ret_t chmod_callback (Dlg_head *h, dlg_msg_t msg, int parm) { char buffer[BUF_TINY]; - int id; + int id = h->current->dlg_id - BUTTONS + single_set * 2; switch (msg) { case DLG_ACTION: - id = h->current->dlg_id - BUTTONS + single_set * 2; - if (id >= 0) { c_stat ^= check_perm[id].mode; g_snprintf (buffer, sizeof (buffer), "%o", c_stat); @@ -167,8 +165,7 @@ chmod_callback (Dlg_head *h, dlg_msg_t msg, int parm) return MSG_HANDLED; case DLG_KEY: - if ((parm == 'T' || parm == 't' || parm == KEY_IC) - && h->current->dlg_id >= BUTTONS - single_set * 2) { + if ((parm == 'T' || parm == 't' || parm == KEY_IC) && id > 0) { chmod_toggle_select (h, id); if (parm == KEY_IC) dlg_one_down (h);