Ignore:
Timestamp:
Jun 3, 2009, 7:10:28 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3094@localhost: bruno | 2009-06-03 17:25:25 +0200

Replaces strcpy in 5 source where no other impact by mr_asprintf. Improves quality report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-cli.c

    r2211 r2214  
    9898        flag_set[i] = FALSE;
    9999    }
    100     //  strcpy (bkpinfo->scratchdir, "/home");
    101100    for (j = 1; j <= MAX_NOOF_MEDIA; j++) {
    102101        bkpinfo->media_size[j] = 650;
     
    669668
    670669    malloc_string(tmp);
    671     malloc_string(psz);
    672670
    673671    assert(bkpinfo != NULL);
     
    11241122    {
    11251123//      strncpy(psz, list_of_NFS_devices_and_mounts(), MAX_STR_LEN);
    1126         strncpy(psz, list_of_NFS_mounts_only(), MAX_STR_LEN);
     1124        asprintf(&psz, "%s", list_of_NFS_mounts_only());
    11271125        if (bkpinfo->exclude_paths[0]) {
    11281126            strncat(bkpinfo->exclude_paths, " ", 4*MAX_STR_LEN);
    11291127        }
    11301128        strncat(bkpinfo->exclude_paths, psz, 4*MAX_STR_LEN);
     1129        mr_free(psz);
     1130
    11311131        log_msg(3, "-N means we're now excluding %s",
    11321132                bkpinfo->exclude_paths);
     
    11391139
    11401140    if (flag_set['b']) {
    1141         strcpy(psz, flag_val['b']);
     1141        mr_asprintf(&psz, flag_val['b']);
    11421142        log_msg(1, "psz = '%s'", psz);
    11431143        if (psz[strlen(psz) - 1] == 'k') {
     
    11471147            itbs = atol(psz);
    11481148        }
     1149        mr_free(psz);
    11491150        log_msg(1, "'%s' --> %ld", flag_val['b'], itbs);
    11501151        log_msg(1, "Internal tape block size is now %ld bytes", itbs);
     
    14211422
    14221423    paranoid_free(tmp);
    1423     paranoid_free(psz);
    14241424    return (retval);
    14251425}
Note: See TracChangeset for help on using the changeset viewer.