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

[PATCH] Use long for timezone in pretty.c:show_ident_date()

From
Brian Gernhardt <brian@gernhardtsoftware.com>
Date
Mar 7, 2014, 18:47 UTC
Message-ID
<1394218076-70398-1-git-send-email-brian@gernhardtsoftware.com>

The value is parsed with strtol and compared against LONG_MIN and LONG_MAX, which doesn't make much sense for an int.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
---
 pretty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pretty.c b/pretty.c
index 3b811ed..29ebc4f 100644
--- a/pretty.c
+++ b/pretty.c
@@ -397,7 +397,7 @@ static const char *show_ident_date(const struct ident_split *ident,
 				   enum date_mode mode)
 {
 	unsigned long date = 0;
-	int tz = 0;
+	long tz = 0;
 
 	if (ident->date_begin && ident->date_end)
 		date = strtoul(ident->date_begin, NULL, 10);
-- 
1.9.0.281.gfc51f0a.dirty
Next: Eric Sunshine
Message 1 of 2 in “Use long for timezone in pretty.c:show_ident_date()”
  1. Use long for timezone in pretty.c:show_ident_date()Brian Gernhardt, Mar 7, 2014
  2. Eric SunshineMar 7, 2014

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.