r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[abartlet/samba.git/.git] / source / nmbd / nmbd_namelistdb.c
index 60023a7ed5e994b8939ce260097f883104858876..75259a3672b05b43ed4bc456e61d06431cd861a5 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
 */
 
@@ -120,7 +119,7 @@ struct name_record *find_name_on_subnet(struct subnet_record *subrec,
                if( self_only && (name_ret->data.source != SELF_NAME) && (name_ret->data.source != PERMANENT_NAME) ) {
                        DEBUG( 9, ( "find_name_on_subnet: on subnet %s - self name %s NOT FOUND\n",
                                                subrec->subnet_name, nmb_namestr(nmbname) ) );
-                       return False;
+                       return NULL;
                }
 
                DEBUG( 9, ("find_name_on_subnet: on subnet %s - found name %s source=%d\n",
@@ -564,15 +563,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");
        }