Ignore:
Timestamp:
Jun 21, 2013, 6:48:23 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Fix #706 by removing usage of MAX_NOOF_MEDIA and an array for media_size in bkpinfo.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/common/libmondo-string.c

    r3042 r3150  
    222222    assert_string_is_neither_NULL_nor_zerolength(incoming);
    223223
    224     malloc_string(tmp);
    225224    if (!incoming[0]) {
    226         free(tmp);
    227225        return (0);
    228226    }
     
    230228        fatal_error("Please use integers only. No decimal points.");
    231229    }
     230    malloc_string(tmp);
    232231    strcpy(tmp, incoming);
    233232    i = (int) strlen(tmp);
     
    10761075
    10771076
    1078     if (bkpinfo->media_size[g_current_media_number] <= 0)
     1077    if (bkpinfo->media_size <= 0)
    10791078//    { fatal_error( "percentage_media_full_comment() - unknown media size"); }
    10801079    {
     
    10861085/* update screen */
    10871086    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    1088         percentage =
    1089             (int) (g_tape_posK / 10 /
    1090                    bkpinfo->media_size[g_current_media_number]);
     1087        percentage = (int) (g_tape_posK / 10 / bkpinfo->media_size);
    10911088        if (percentage > 100) {
    10921089            percentage = 100;
     
    10951092    } else {
    10961093        percentage =
    1097             (int) (space_occupied_by_cd(bkpinfo->scratchdir) * 100 / 1024 /
    1098                    bkpinfo->media_size[g_current_media_number]);
     1094            (int) (space_occupied_by_cd(bkpinfo->scratchdir) * 100 / 1024 / bkpinfo->media_size);
    10991095        mds = media_descriptor_string(bkpinfo->backup_media_type);
    11001096        sprintf(outstr, "%s %d: [", mds, g_current_media_number);
Note: See TracChangeset for help on using the changeset viewer.