Ignore:
Timestamp:
Apr 30, 2007, 1:50:20 AM (12 years ago)
Author:
bruno
Message:

MAX_NOOF_MEDIA is gone and media_size in bkpinfo struct is now a single long field and not an array anymore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r1264 r1365  
    9292        flag_set[i] = FALSE;
    9393    }
    94     for (j = 1; j <= MAX_NOOF_MEDIA; j++) {
    95         bkpinfo->media_size[j] = 650;
    96     }                           /* default */
     94    bkpinfo->media_size = (long)650;
    9795    res =
    9896        retrieve_switches_from_command_line(argc, argv, flag_val,
     
    155153    assert(value != NULL);
    156154
    157     bkpinfo->media_size[0] = -1;    /* dummy value */
    158     for (j = 1, p = value; j < MAX_NOOF_MEDIA && strchr(p, ',');
    159          j++, p = strchr(p, ',') + 1) {
     155    bkpinfo->media_size = 0L;   /* dummy value */
     156    for ( p = value; strchr(p, ','); p = strchr(p, ',') + 1) {
    160157        mr_asprintf(&tmp, p);
    161158        q = strchr(tmp, ',');
     
    163160            *q = '\0';
    164161        }
    165         bkpinfo->media_size[j] = friendly_sizestr_to_sizelong(tmp);
     162        bkpinfo->media_size = friendly_sizestr_to_sizelong(tmp);
    166163        mr_free(tmp);
    167164
    168         mr_msg(3, "media_size[%d] = %ld", j,
    169                 bkpinfo->media_size[j]);
    170     }
    171     for (; j <= MAX_NOOF_MEDIA; j++) {
    172         bkpinfo->media_size[j] = friendly_sizestr_to_sizelong(p);
    173     }
    174     for (j = 1; j <= MAX_NOOF_MEDIA; j++) {
    175         if (bkpinfo->media_size[j] <= 0) {
    176             mr_msg(1, "You gave media #%d an invalid size\n", j);
    177             return (-1);
    178         }
     165        mr_msg(3, "media_size = %ld", bkpinfo->media_size);
     166    }
     167    if (bkpinfo->media_size <= 0L) {
     168        mr_msg(1, "You gave media an invalid size\n");
     169        return (-1);
    179170    }
    180171    return (0);
     
    469460                }
    470461            } else if (flag_set['u'] || flag_set['t']) {
    471                 for (i = 0; i <= MAX_NOOF_MEDIA; i++) {
    472                     bkpinfo->media_size[i] = 0;
    473                 }
     462                bkpinfo->media_size = 0L;
    474463            } else {
    475464                retval++;
Note: See TracChangeset for help on using the changeset viewer.