+2009-11-17 18:35 Christos Zoulas <christos@zoulas.com<
+
+ * ctime/asctime can return NULL on some OS's although
+ they should not (Toshit Antani)
+
2009-09-14 13:49 Christos Zoulas <christos@zoulas.com<
* Centralize magic path handling routines and remove the
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: print.c,v 1.66 2009/02/03 20:27:51 christos Exp $")
+FILE_RCSID("@(#)$File: print.c,v 1.67 2009/10/19 13:10:20 christos Exp $")
#endif /* lint */
#include <string.h>
(void)time(&now);
tm1 = localtime(&now);
if (tm1 == NULL)
- return "*Invalid time*";
+ goto out;
daylight = tm1->tm_isdst;
}
#endif /* HAVE_TM_ISDST */
t += 3600;
tm = gmtime(&t);
if (tm == NULL)
- return "*Invalid time*";
+ goto out;
pp = asctime(tm);
}
+ if (pp == NULL)
+ goto out;
pp[strcspn(pp, "\n")] = '\0';
return pp;
+out:
+ return "*Invalid time*";
}