Ignore:
Timestamp:
Sep 20, 2009, 2:53:32 AM (15 years ago)
Author:
Bruno Cornec
Message:

severity_of_difference is now allocating memory freed by the caller

File:
1 edited

Legend:

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

    r2413 r2414  
    851851 * @return The severity (1-3).
    852852 */
    853 int severity_of_difference(char *fn, char *out_reason) {
    854 
    855     int sev;
     853int severity_of_difference(char *fn, char **out_reason) {
     854
     855    int sev = 3;
    856856    char *reason = NULL;
    857857    char *filename = NULL;
     
    867867    }
    868868
    869     sev = 3;
    870869    mr_asprintf(reason, "Changed since backup. Consider running a differential backup in a day or two.");
    871870
     
    956955        mr_asprintf(reason, "Temporary file (a lockfile, perhaps) used by software such as X or KDE to register its presence.");
    957956    }
    958     if (out_reason) {
    959         strcpy(out_reason, reason);
     957
     958    if (reason != NULL) {
     959        *out_reason = reason;
    960960    }
    961961    mr_free(filename);
    962     mr_free(reason);
    963962    return (sev);
    964963}
Note: See TracChangeset for help on using the changeset viewer.