char *ldap_int_ctime( const time_t *tp, char *buf )
{
-#ifdef HAVE_CTIME_R
+#if defined( HAVE_CTIME_R ) && defined( CTIME_R_NARGS )
+# if (CTIME_R_NARGS > 3) || (CTIME_R_NARGS < 2)
+ choke me! nargs should have 2 or 3
+# elif CTIME_R_NARGS > 2
+ return ctime_r(tp,buf,26);
+# else
return ctime_r(tp,buf);
+# endif
#else
return ctime(tp);
#endif