Skip to content

Commit

Permalink
Fix size_t specifiers in format strings
Browse files Browse the repository at this point in the history
  • Loading branch information
MatzeB committed Jan 3, 2015
1 parent 6f7fdba commit b080078
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion text.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b080078

Please sign in to comment.