Module Name:    src
Committed By:   christos
Date:           Sun Apr  4 01:37:35 UTC 2010

Modified Files:
        src/dist/ntp/libopts: save.c

Log Message:
ctime can return NULL


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/dist/ntp/libopts/save.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/ntp/libopts/save.c
diff -u src/dist/ntp/libopts/save.c:1.5 src/dist/ntp/libopts/save.c:1.6
--- src/dist/ntp/libopts/save.c:1.5	Sat Aug 23 05:10:31 2008
+++ src/dist/ntp/libopts/save.c	Sat Apr  3 21:37:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: save.c,v 1.5 2008/08/23 09:10:31 kardel Exp $	*/
+/*	$NetBSD: save.c,v 1.6 2010/04/04 01:37:35 christos Exp $	*/
 
 
 /*
@@ -388,9 +388,10 @@
 
     {
         time_t  timeVal = time( NULL );
-        char*   pzTime  = ctime( &timeVal );
+        char*   pzTime;
 
-        fprintf( fp, zPresetFile, pzTime );
+	if ((pzTime = ctime( &timeVal )) != NULL)
+		fprintf( fp, zPresetFile, pzTime );
 #ifdef HAVE_ALLOCATED_CTIME
         /*
          *  The return values for ctime(), localtime(), and gmtime()

Reply via email to