Fixed invalid parsing of text-mode received SMS timestamp
[mdsms.git] / mdsms.c
diff --git a/mdsms.c b/mdsms.c
index 59f9bd9..700cdc9 100644 (file)
--- a/mdsms.c
+++ b/mdsms.c
@@ -1,3 +1,4 @@
+#define WANT_DECLARATIONS 1
 #include "config.h"
 #ifndef lint
 static char rcsid[] ATTR_UNUSED = "$Id$";
@@ -69,6 +70,13 @@ static char rcsid[] ATTR_UNUSED = "$Id$";
 #include "getopt.h"
 #endif
 
+
+/* Always override possible system defintions as it is safe (used by glib) */
+#undef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+#undef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+
 #define NELEM(x) (sizeof((x))/sizeof(*(x)))
 
 #ifndef DEBUG
@@ -1626,8 +1634,6 @@ int i;
        memset(&tm,0,sizeof(tm)); /* may be redundant */
        for (i=0;i<NELEM(timeparse);i++)
                GETTIME(i)=DIGIT2ASC(s+timeparse[i].strpos);
-       if (tm.tm_year<70) tm.tm_year+=100;
-       tm.tm_mon--;
        maketime(s+2);
        return(1);
 #undef DIGIT2ASC