Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
test-date: fix sscanf type conversion
author
Jeff King
<peff@peff.net>
Tue, 6 Jul 2010 07:54:33 +0000
(
03:54
-0400)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 6 Jul 2010 15:42:15 +0000
(08:42 -0700)
Reading into a time_t isn't portable, since we don't know
the exact type. Instead, use an unsigned long, which is what
show_date wants, anyway.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
test-date.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
b4cf0f1
)
diff --git
a/test-date.c
b/test-date.c
index ac6854a541ec762a68b01bbc5f591c6c49d71cac..6bcd5b03c078bc532e074ef8e8775a51d0eef219 100644
(file)
--- a/
test-date.c
+++ b/
test-date.c
@@
-20,12
+20,12
@@
static void parse_dates(char **argv, struct timeval *now)
{
for (; *argv; argv++) {
char result[100];
-
time_t
t;
+
unsigned long
t;
int tz;
result[0] = 0;
parse_date(*argv, result, sizeof(result));
- if (sscanf(result, "%l
d
%d", &t, &tz) == 2)
+ if (sscanf(result, "%l
u
%d", &t, &tz) == 2)
printf("%s -> %s\n",
*argv, show_date(t, tz, DATE_ISO8601));
else