From 514666593a5e08b7b174a882cc27fd650d85dae9 Mon Sep 17 00:00:00 2001 From: zharovdv Date: Sat, 20 Jan 2018 17:03:32 +0300 Subject: [PATCH] Update Time.cpp LEAP_YEAR bad macro - need in parentheses. --- Time.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Time.cpp b/Time.cpp index 3488ba2..8e53e56 100644 --- a/Time.cpp +++ b/Time.cpp @@ -144,7 +144,7 @@ int year(time_t t) { // the year for the given time /* These are for interfacing with time serivces and are not normally needed in a sketch */ // leap year calulator expects year argument as years offset from 1970 -#define LEAP_YEAR(Y) ( ((1970+Y)>0) && !((1970+Y)%4) && ( ((1970+Y)%100) || !((1970+Y)%400) ) ) +#define LEAP_YEAR(Y) ( ((1970+(Y))>0) && !((1970+(Y))%4) && ( ((1970+(Y))%100) || !((1970+(Y))%400) ) ) static const uint8_t monthDays[]={31,28,31,30,31,30,31,31,30,31,30,31}; // API starts months from 1, this array starts from 0