{"thread":{"id":"6557","subject":"[PATCH 1/4] Prefer %d over %i in printf format strings.","startedAt":"2007-01-27T06:51:56Z","lastAt":"2007-01-27T06:51:56Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"32805","messageId":"20070127065156.GA10380@spearce.org","threadId":"6557","inReplyTo":null,"subject":"[PATCH 1/4] Prefer %d over %i in printf format strings.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-01-27T06:51:56Z","receivedAt":"2007-01-27T06:51:56Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"The git project seems to prefer using %d when formatting signed\ninteger values.  These handful of locations were noticed by Junio\nas not conforming.  At least one of them was my fault, perhaps\nthe others were too.  :-)\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n builtin-describe.c |    2 +-\n receive-pack.c     |    2 +-\n sha1_file.c        |    2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-describe.c b/builtin-describe.c\nindex 4921eee..f8afb9c 100644\n--- a/builtin-describe.c\n+++ b/builtin-describe.c\n@@ -182,7 +182,7 @@ static void describe(const char *arg, int last_one)\n \t\tfprintf(stderr, \"traversed %lu commits\\n\", seen_commits);\n \t\tif (gave_up_on) {\n \t\t\tfprintf(stderr,\n-\t\t\t\t\"more than %i tags found; listed %i most recent\\n\"\n+\t\t\t\t\"more than %d tags found; listed %d most recent\\n\"\n \t\t\t\t\"gave up search at %s\\n\",\n \t\t\t\tmax_candidates, max_candidates,\n \t\t\t\tsha1_to_hex(gave_up_on->object.sha1));\ndiff --git a/receive-pack.c b/receive-pack.c\nindex 7d26326..19bc685 100644\n--- a/receive-pack.c\n+++ b/receive-pack.c\n@@ -317,7 +317,7 @@ static const char *unpack(void)\n \t\tchar keep_arg[256];\n \t\tchar packname[46];\n \n-\t\ts = sprintf(keep_arg, \"--keep=receive-pack %i on \", getpid());\n+\t\ts = sprintf(keep_arg, \"--keep=receive-pack %d on \", getpid());\n \t\tif (gethostname(keep_arg + s, sizeof(keep_arg) - s))\n \t\t\tstrcpy(keep_arg + s, \"localhost\");\n \ndiff --git a/sha1_file.c b/sha1_file.c\nindex 498665e..335b4b4 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -1326,7 +1326,7 @@ void *unpack_entry(struct packed_git *p, unsigned long offset,\n \t\tretval = unpack_compressed_entry(p, &w_curs, offset, size);\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"unknown object type %i in %s\", kind, p->pack_name);\n+\t\tdie(\"unknown object type %d in %s\", kind, p->pack_name);\n \t}\n \tunuse_pack(&w_curs);\n \treturn retval;\n-- \n1.5.0.rc2.g8a816\n"}]}