]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_restore.c
ebl Modify disk-changer to check if slot contains something before
[bacula/bacula] / bacula / src / dird / ua_restore.c
index e0a364fe3dbe2bfb20a170394441f427d9c6c174..500c0c1aa7fe8ae28095840145a72ee52eb7938b 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2008 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.
@@ -1241,11 +1241,12 @@ bail_out:
  */
 int get_next_jobid_from_list(char **p, JobId_t *JobId)
 {
-   char jobid[30];
+   const int maxlen = 30;
+   char jobid[maxlen+1];
    char *q = *p;
 
    jobid[0] = 0;
-   for (int i=0; i<(int)sizeof(jobid); i++) {
+   for (int i=0; i<maxlen; i++) {
       if (*q == 0) {
          break;
       } else if (*q == ',') {
@@ -1410,6 +1411,8 @@ void find_storage_resource(UAContext *ua, RESTORE_CTX &rx, char *Storage, char *
 
    /* Take command line arg, or ask user if none */
    rx.store = get_storage_resource(ua, false /* don't use default */);
-   Dmsg1(200, "Set store=%s\n", rx.store->name());
+   if (rx.store) {
+      Dmsg1(200, "Set store=%s\n", rx.store->name());
+   }
 
 }