diff options
Diffstat (limited to 'source3/nmbd/nmbd_namelistdb.c')
-rw-r--r-- | source3/nmbd/nmbd_namelistdb.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/source3/nmbd/nmbd_namelistdb.c b/source3/nmbd/nmbd_namelistdb.c index 60023a7ed5..fb32ce1aad 100644 --- a/source3/nmbd/nmbd_namelistdb.c +++ b/source3/nmbd/nmbd_namelistdb.c @@ -564,15 +564,31 @@ void dump_name_record( struct name_record *namerec, XFILE *fp) x_fprintf(fp,"Source = %s\nb_flags = %x\t", src_type, namerec->data.nb_flags); if(namerec->data.death_time != PERMANENT_TTL) { + const char *asct; tm = localtime(&namerec->data.death_time); - x_fprintf(fp, "death_time = %s\t", asctime(tm)); + if (!tm) { + return; + } + asct = asctime(tm); + if (!asct) { + return; + } + x_fprintf(fp, "death_time = %s\t", asct); } else { x_fprintf(fp, "death_time = PERMANENT\t"); } if(namerec->data.refresh_time != PERMANENT_TTL) { + const char *asct; tm = localtime(&namerec->data.refresh_time); - x_fprintf(fp, "refresh_time = %s\n", asctime(tm)); + if (!tm) { + return; + } + asct = asctime(tm); + if (!asct) { + return; + } + x_fprintf(fp, "refresh_time = %s\n", asct); } else { x_fprintf(fp, "refresh_time = PERMANENT\n"); } |