git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use long for timezone in pretty.c:show_ident_date()
@ 2014-03-07 18:47 Brian Gernhardt
  2014-03-07 19:29 ` Eric Sunshine
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Gernhardt @ 2014-03-07 18:47 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Use long for timezone in pretty.c:show_ident_date()
  2014-03-07 18:47 [PATCH] Use long for timezone in pretty.c:show_ident_date() Brian Gernhardt
@ 2014-03-07 19:29 ` Eric Sunshine
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Sunshine @ 2014-03-07 19:29 UTC (permalink / raw)
  To: Brian Gernhardt; +Cc: Git List, Junio C Hamano

On Fri, Mar 7, 2014 at 1:47 PM, Brian Gernhardt
<brian@gernhardtsoftware.com> wrote:
> 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>

Thanks. Find a more complete fix here [1].

[1]: http://thread.gmane.org/gmane.comp.version-control.git/243582/focus=243617

> ---
>  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
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-07 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-07 18:47 [PATCH] Use long for timezone in pretty.c:show_ident_date() Brian Gernhardt
2014-03-07 19:29 ` Eric Sunshine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).