From 5745c0a11f225ca3485ebf7ebd51b0934ae6df28 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 31 Jul 2005 20:20:37 +0000 Subject: [PATCH] simplify further git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2955 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/winio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/winio.c b/src/winio.c index 554697f8..a4272256 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3824,14 +3824,14 @@ void display_main_list(void) void do_cursorpos(bool constant) { char c; - size_t i = 0, cur_xpt = xplustabs() + 1; + size_t i, cur_xpt = xplustabs() + 1; size_t cur_lenpt = strlenpt(openfile->current->data) + 1; int linepct, colpct, charpct; assert(openfile->fileage != NULL && openfile->current != NULL); - if (openfile->current->prev != NULL) - i += get_totsize(openfile->fileage, openfile->current->prev); + i = (openfile->current->prev != NULL) ? + get_totsize(openfile->fileage, openfile->current->prev) : 0; c = openfile->current->data[openfile->current_x]; openfile->current->data[openfile->current_x] = '\0'; i += mbstrlen(openfile->current->data); -- 2.39.5