summaryrefslogtreecommitdiff
path: root/test-date.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2010-07-06 07:54:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-07-06 15:42:15 (GMT)
commitd66ee046fc8597af62daeb890b15d5799c786b0d (patch)
treef8f7260a1fd8555890224170637a2997a95979d3 /test-date.c
parentb4cf0f1784362fb4aa2383d8d5d829caa92ca3a0 (diff)
downloadgit-d66ee046fc8597af62daeb890b15d5799c786b0d.zip
git-d66ee046fc8597af62daeb890b15d5799c786b0d.tar.gz
git-d66ee046fc8597af62daeb890b15d5799c786b0d.tar.bz2
test-date: fix sscanf type conversion
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>
Diffstat (limited to 'test-date.c')
-rw-r--r--test-date.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test-date.c b/test-date.c
index ac6854a..6bcd5b0 100644
--- 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, "%ld %d", &t, &tz) == 2)
+ if (sscanf(result, "%lu %d", &t, &tz) == 2)
printf("%s -> %s\n",
*argv, show_date(t, tz, DATE_ISO8601));
else