# [PATCH] test-parse-options: use appropriate cast in length_callback

2 messages from 2008-08-14 to 2008-08-14. Participants: Brandon Casey, Junio C Hamano.
Thread: https://gitlist.dev/t/14997

## Brandon Casey, 2008-08-14 00:48

Subject: [PATCH] test-parse-options: use appropriate cast in length_callback
Message-ID: <u9kSfvaPV5O7E74203zUsAGug_d6ifoE65miBrOTQbXuuqogK67SOA@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/u9kSfvaPV5O7E74203zUsAGug_d6ifoE65miBrOTQbXuuqogK67SOA%40cipher.nrlssc.navy.mil

```
OPT_CALLBACK() is passed &integer which is now an "int" rather than
"unsigned long". Update the length_callback function.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 test-parse-options.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/test-parse-options.c b/test-parse-options.c
index 6e18083..61d2c39 100644
--- a/test-parse-options.c
+++ b/test-parse-options.c
@@ -15,7 +15,7 @@ int length_callback(const struct option *opt, const char *arg, int unset)
 	if (unset)
 		return 1; /* do not support unset */
 
-	*(unsigned long *)opt->value = strlen(arg);
+	*(int *)opt->value = strlen(arg);
 	return 0;
 }
 
-- 
1.6.0.rc2.51.g0dc95

```

## Junio C Hamano, 2008-08-14 01:11

Subject: Re: [PATCH] test-parse-options: use appropriate cast in length_callback
Message-ID: <7v1w0sienw.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v1w0sienw.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <u9kSfvaPV5O7E74203zUsAGug_d6ifoE65miBrOTQbXuuqogK67SOA@cipher.nrlssc.navy.mil>

```
Good eyes.  Thanks.

```
