nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 62ebd93579506c9f29d0a46ea2ed448006c4cb88
parent a10fdc3fb1208d23bbfa3d8d16caf63714e14e2d
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Mon,  6 Nov 2017 07:13:50 -0600

tweaks: use printf's z modifier for (s)size_t, instead of casting

Diffstat:
Msrc/rcfile.c | 2+-
Msrc/text.c | 5++---
Msrc/winio.c | 8+++-----
3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -146,7 +146,7 @@ void rcfile_error(const char *msg, ...) rcfile_with_errors = strdup(nanorc); if (lineno > 0) - fprintf(stderr, _("Error in %s on line %lu: "), nanorc, (unsigned long)lineno); + fprintf(stderr, _("Error in %s on line %zu: "), nanorc, lineno); va_start(ap, msg); vfprintf(stderr, _(msg), ap); diff --git a/src/text.c b/src/text.c @@ -3523,9 +3523,8 @@ void do_wordlinechar_count(void) openfile->placewewant = pww_save; /* Display the total word, line, and character counts on the statusbar. */ - statusline(HUSH, _("%sWords: %lu Lines: %ld Chars: %lu"), was_mark ? - _("In Selection: ") : "", (unsigned long)words, (long)nlines, - (unsigned long)chars); + statusline(HUSH, _("%sWords: %zu Lines: %zd Chars: %zu"), was_mark ? + _("In Selection: ") : "", words, nlines, chars); } #endif /* !NANO_TINY */ diff --git a/src/winio.c b/src/winio.c @@ -3390,11 +3390,9 @@ void do_cursorpos(bool force) charpct = (openfile->totsize == 0) ? 0 : 100 * sum / openfile->totsize; statusline(HUSH, - _("line %ld/%ld (%d%%), col %lu/%lu (%d%%), char %lu/%lu (%d%%)"), - (long)openfile->current->lineno, - (long)openfile->filebot->lineno, linepct, - (unsigned long)cur_xpt, (unsigned long)cur_lenpt, colpct, - (unsigned long)sum, (unsigned long)openfile->totsize, charpct); + _("line %zd/%zd (%d%%), col %zu/%zu (%d%%), char %zu/%zu (%d%%)"), + openfile->current->lineno, openfile->filebot->lineno, linepct, + cur_xpt, cur_lenpt, colpct, sum, openfile->totsize, charpct); /* Displaying the cursor position should not suppress it next time. */ suppress_cursorpos = FALSE;