From b08007898fa72777afb566c5ed208bb5a10d5e00 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Sat, 3 Jan 2015 02:08:24 -0800 Subject: Fix size_t specifiers in format strings --- config.def.h | 2 +- text.c | 2 +- window.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.def.h b/config.def.h index aac28a8..96ebf9e 100644 --- a/config.def.h +++ b/config.def.h @@ -79,7 +79,7 @@ static void statusbar(EditorWin *win) { text_modified(win->text) ? "[+]" : "", vis->recording ? "recording": ""); char buf[win->width + 1]; - int len = snprintf(buf, win->width, "%d, %d", line, col); + int len = snprintf(buf, win->width, "%zd, %zd", line, col); if (len > 0) { buf[len] = '\0'; mvwaddstr(win->statuswin, 0, win->width - len - 1, buf); diff --git a/text.c b/text.c index 7cf30a5..7d17bbf 100644 --- a/text.c +++ b/text.c @@ -756,7 +756,7 @@ Text *text_load_fd(int fd) { } static void print_piece(Piece *p) { - fprintf(stderr, "index: %d\tnext: %d\tprev: %d\t len: %d\t data: %p\n", p->index, + fprintf(stderr, "index: %d\tnext: %d\tprev: %d\t len: %zd\t data: %p\n", p->index, p->next ? p->next->index : -1, p->prev ? p->prev->index : -1, p->len, p->data); diff --git a/window.c b/window.c index 48044c5..a4d80f4 100644 --- a/window.c +++ b/window.c @@ -108,7 +108,7 @@ void window_selection_clear(Win *win) { static int window_numbers_width(Win *win) { if (!win->winnum) return 0; - return snprintf(NULL, 0, "%d", win->topline->lineno + win->height - 1) + 1; + return snprintf(NULL, 0, "%zd", win->topline->lineno + win->height - 1) + 1; } static void window_numbers_draw(Win *win) { -- cgit v1.2.3