{"thread":{"id":"25963","subject":"[PATCH 13/14] transport.c: Initialise variable to suppress msvc warning","startedAt":"2010-12-04T19:11:40Z","lastAt":"2010-12-04T19:11:40Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":14},"messages":[{"id":"157322","messageId":"4CFA926C.70501@ramsay1.demon.co.uk","threadId":"25963","inReplyTo":null,"subject":"[PATCH 13/14] transport.c: Initialise variable to suppress msvc warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-04T19:11:40Z","receivedAt":"2010-12-04T19:11:40Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nThe msvc compiler thinks that a variable could be used while\nuninitialised and issues the following warning:\n\n    ...\\git\\transport.c(107) : warning C4700: uninitialized local \\\n        variable 'cmp' used\n\nIn order to suppress the warning, we simply initialise the\nvariable to zero.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n transport.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/transport.c b/transport.c\nindex 0078660..1dca6d4 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -104,7 +104,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)\n \t\treturn;\n \n \tfor (;;) {\n-\t\tint cmp = cmp, len;\n+\t\tint cmp = 0, len;\n \n \t\tif (!fgets(buffer, sizeof(buffer), f)) {\n \t\t\tfclose(f);\n-- \n1.7.3\n"}]}