]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/btime.c
kes Add dynamic dll entry point for SHGetFolderPath to Win32 code.
[bacula/bacula] / bacula / src / lib / btime.c
index 7011b74a9dda4f83560f9f95c1b3952c75be1a68..f2777ea8c61b05515c922f9dc3014fdec8bc37e7 100644 (file)
@@ -1,22 +1,37 @@
 /*
- * Bacula time and date routines -- John Walker
+ * Bacula floating point time and date routines -- John Walker
+ *
+ * Later double precision integer time/date routines -- Kern Sibbald
  *
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 /* Concerning times. There are a number of differnt time standards
@@ -105,6 +120,11 @@ utime_t str_to_utime(char *str)
    struct tm tm;
    time_t ttime;
 
+   /* Check for bad argument */
+   if (!str || *str == 0) {
+      return 0;
+   }
+
    if (sscanf(str, "%d-%d-%d %d:%d:%d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday,
                                         &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
       return 0;