Ignore:
Timestamp:
May 13, 2009, 4:34:00 AM (15 years ago)
Author:
Bruno Cornec
Message:
  • Remove useless function look_for_weird_formats
  • Adds a test program for mountlist management to find a seg. fault bug when using a large mountlist file
File:
1 edited

Legend:

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

    r2190 r2202  
    14441444    /*@ ints ** */
    14451445    int opt = 0;
    1446     char tmp[MAX_STR_LEN];
     1446    char *tmp = NULL;
    14471447    int i = 0;
    14481448    int len;
     
    14671467            if (flag_set[optopt]) {
    14681468                bad_switches = TRUE;
    1469                 sprintf(tmp, "Switch -%c previously defined as %s\n", opt,
     1469                (void) asprintf(&tmp, "Switch -%c previously defined as %s\n", opt,
    14701470                        flag_val[i]);
    14711471                log_to_screen(tmp);
     1472                paranoid_free(tmp);
    14721473            } else {
    14731474                flag_set[opt] = TRUE;
     
    14831484                        if (strchr(flag_val[opt], '/')
    14841485                            && flag_val[opt][0] != '/') {
    1485                             sprintf(tmp,
     1486                            (void)asprintf(&tmp,
    14861487                                    "-%c flag --- must be absolute path --- '%s' isn't absolute",
    14871488                                    opt, flag_val[opt]);
    14881489                            log_to_screen(tmp);
     1490                            paranoid_free(tmp);
    14891491                            bad_switches = TRUE;
    14901492                        }
     
    14971499    for (i = optind; i < argc; i++) {
    14981500        bad_switches = TRUE;
    1499         sprintf(tmp, "Invalid arg -- %s\n", argv[i]);
     1501        (void)asprintf(&tmp, "Invalid arg -- %s\n", argv[i]);
    15001502        log_to_screen(tmp);
     1503        paranoid_free(tmp);
    15011504    }
    15021505    return (bad_switches);
Note: See TracChangeset for help on using the changeset viewer.