MSVC: fix t0040-parse-options crash
On 64-bit MSVC, pointers are 64 bit but `long` is only 32. Thus, casting string to `unsigned long`, which is redundand on other platforms, throws away important bits and when later cast to `intptr_t` results in corrupt pointer. This patch fixes test-parse-options by replacing harming cast with correct one. Signed-off-by: Marat Radchenko <marat@slonopotamus.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Marat Radchenko committed
Mar 30, 2014 at 15:08 UTC
e25c070cb5c85ac3abe787373563a31c8893a669
1 file changed
+1
-1
test-parse-options.c
+1
-1
@@ -60,7 +60,7 @@ int main(int argc, char **argv)
60
OPT_STRING('o', NULL, &string, "str", "get another string"),
61
OPT_NOOP_NOARG(0, "obsolete"),
62
OPT_SET_PTR(0, "default-string", &string,
63
- "set string to default", (unsigned long)"default"),
63
+ "set string to default", (intptr_t)"default"),
64
OPT_STRING_LIST(0, "list", &list, "str", "add str to list"),
65
OPT_GROUP("Magic arguments"),
66
OPT_ARGUMENT("quux", "means --quux"),