X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=date.c;h=1c1917b4e8768b0046729e19505d6f1b0845a0d8;hb=a5370b16c34993c1d0f65171d5704244901e005b;hp=416ea579a3eb1dbc910817413f995556ad115b29;hpb=d9ad59e7636d98daa6131e9fd2cb2b4f5745a853;p=git.git diff --git a/date.c b/date.c index 416ea579..1c1917b4 100644 --- a/date.c +++ b/date.c @@ -123,8 +123,6 @@ static const struct { { "IDLE", +12, 0, }, /* International Date Line East */ }; -#define NR_TZ (sizeof(timezone_names) / sizeof(timezone_names[0])) - static int match_string(const char *date, const char *str) { int i = 0; @@ -173,7 +171,7 @@ static int match_alpha(const char *date, struct tm *tm, int *offset) } } - for (i = 0; i < NR_TZ; i++) { + for (i = 0; i < ARRAY_SIZE(timezone_names); i++) { int match = match_string(date, timezone_names[i].name); if (match >= 3) { int off = timezone_names[i].offset;