All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Grimm <koreth@midwinter.com>
To: git@vger.kernel.org
Subject: [tig PATCH] Fix integer type mismatch on 64-bit systems
Date: Sun, 3 Jun 2007 14:12:06 -0700	[thread overview]
Message-ID: <20070603211206.GA16445@midwinter.com> (raw)

fprintf wants an int parameter for the field width of a "%.*s" expression, but
the code was passing a size_t instead. This potentially broke systems where
sizeof(size_t) != sizeof(int). And even on systems where it did't break,
it still caused a compiler warning.
---
 tig.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tig.c b/tig.c
index 6adfb33..b09d91b 100644
--- a/tig.c
+++ b/tig.c
@@ -1153,7 +1153,7 @@ read_option(char *opt, size_t optlen, char *value, size_t valuelen)
 
 	if (status == ERR) {
 		fprintf(stderr, "Error on line %d, near '%.*s': %s\n",
-			config_lineno, optlen, opt, config_msg);
+			config_lineno, (int) optlen, opt, config_msg);
 		config_errors = TRUE;
 	}
 
-- 
1.5.2.35.ga334

             reply	other threads:[~2007-06-03 21:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-03 21:12 Steven Grimm [this message]
2007-06-04  6:47 ` [tig PATCH] Fix integer type mismatch on 64-bit systems Jonas Fonseca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070603211206.GA16445@midwinter.com \
    --to=koreth@midwinter.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.