git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Aug 14, 2008, 00:48 UTC
Message-ID
<u9kSfvaPV5O7E74203zUsAGug_d6ifoE65miBrOTQbXuuqogK67SOA@cipher.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
Next: Junio C Hamano
Message 1 of 2 in “test-parse-options: use appropriate cast in length_callback”
  1. test-parse-options: use appropriate cast in length_callbackBrandon Casey, Aug 14, 2008
  2. Junio C HamanoAug 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.