dtcm: Resolve CID 87822
[oweals/cde.git] / cde / programs / dtcm / libDtCmP / getdate.y
index e3238220297fe9660c1d4a46e16996565640c5f4..188b7b7fdd5798d51b7ef4e277cec8485ded6320 100644 (file)
@@ -41,6 +41,7 @@ static  char sccsid[] = "@(#)getdate.y 1.10 94/11/07 Copyr 1993 Sun Microsystems
 
 #include <EUSCompat.h>
 #include <ctype.h>
+#include <string.h>
 #include <time.h>
 #include "getdate.h"
 #ifdef SVR4
@@ -528,11 +529,15 @@ time_t cm_getdate(char *p, struct timeb *now)
        lptr = p;
        if (now == ((struct timeb *) NULL)) {
                now = &ftz;
-#ifdef SVR4
+#if defined(SVR4) || defined(__OpenBSD__)
                tod = time(0);
                lt = localtime(&tod);
                now->time = lt->tm_sec;
+#ifdef __OpenBSD__
+               now->timezone = lt->tm_gmtoff / 60;
+#else
                now->timezone = timezone/60;
+#endif
 #else
                ftime(&ftz);
 #endif /* SVR4 */
@@ -592,5 +597,7 @@ time_t cm_getdate(char *p, struct timeb *now)
        return sdate;
 }
 
-yyerror(s) char *s;
-{}
+void
+yyerror(char *s)
+{
+}