提交 d66ee046 编写于 作者: J Jeff King 提交者: Junio C Hamano

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: NJeff King <peff@peff.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 b4cf0f17
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册