Changeset 146 in MondoRescue for trunk/mondo/mondo/common/newt-specific.c


Ignore:
Timestamp:
Dec 1, 2005, 10:00:14 AM (18 years ago)
Author:
bcornec
Message:

MONDO_LOGFILE used each time now
memory management on libmondo-devices.c
some splint improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/common/newt-specific.c

    r127 r146  
    313313
    314314        system
    315             ("gzip -9c /var/log/mondo-archive.log > /tmp/MA.log.gz 2> /dev/null");
     315            ("gzip -9c "MONDO_LOGFILE" > /tmp/MA.log.gz 2> /dev/null");
    316316        if (!strstr(g_version, "cvs") && !strstr(g_version, "svn")) {
    317317            printf("Please try the latest SVN version ");
     
    686686 * @param title The title of the dialog box.
    687687 * @param b The blurb (e.g. what you want the user to enter).
    688  * @param output The string to put the user's answer in.
     688 * @param output The string to put the user's answer in. It has to be freed by the caller
    689689 * @param maxsize The size in bytes allocated to @p output.
    690690 * @return TRUE if the user pressed OK, FALSE if they pressed Cancel.
     
    707707        char *blurb;
    708708        char *original_contents;
     709        int n = 0;
    709710
    710711        assert_string_is_neither_NULL_nor_zerolength(title);
    711712        assert(b != NULL);
    712         assert(output != NULL);
    713713
    714714        if (g_text_mode) {
     
    716716                ("---promptstring---1--- %s\r\n---promptstring---2--- %s\r\n---promptstring---Q---\r\n-->  ",
    717717                 title, b);
    718             (void) fgets(output, maxsize, stdin);
     718            (void) getline(&output, &n, stdin);
    719719            if (output[strlen(output) - 1] == '\n')
    720720                output[strlen(output) - 1] = '\0';
     
    723723        asprintf(&blurb, b);
    724724        text = newtTextboxReflowed(2, 1, blurb, 48, 5, 5, 0);
    725         asprintf(&original_contents, output);
    726         output[0] = '\0';
     725        original_contents = output;
     726
    727727        type_here =
    728728            newtEntry(2, newtTextboxGetNumLines(text) + 2,
     
    745745        paranoid_free(blurb);
    746746        b_res = newtRunForm(myForm);
    747         strcpy(output, entry_value);
     747        output = entry_value;
    748748        newtPopHelpLine();
    749749        newtFormDestroy(myForm);
    750750        newtPopWindow();
    751751        if (b_res == b_2) {
    752             strcpy(output, original_contents);
     752            paranoid_free(output);
     753            output = original_contents;
    753754            paranoid_free(original_contents);
    754755            return (FALSE);
Note: See TracChangeset for help on using the changeset viewer.