]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/edit.c
Implement first cut DCR in SD
[bacula/bacula] / bacula / src / lib / edit.c
index 99184336cdef5059ca425db706209a834fd67290..9647fdf4b39fc1fd89d324b3cd9d1413da742bd1 100644 (file)
@@ -35,6 +35,9 @@ uint64_t str_to_uint64(char *str)
    register char *p = str;
    register uint64_t value = 0;
 
+   if (!p) {
+      return 0;
+   }
    while (B_ISSPACE(*p)) {
       p++;
    }
@@ -52,15 +55,18 @@ int64_t str_to_int64(char *str)
 {
    register char *p = str;
    register int64_t value;
-   int negative = FALSE;
+   bool negative = false;
 
+   if (!p) {
+      return 0;
+   }
    while (B_ISSPACE(*p)) {
       p++;
    }
    if (*p == '+') {
       p++;
    } else if (*p == '-') {
-      negative = TRUE;
+      negative = true;
       p++;
    }
    value = str_to_uint64(p);