Ignore:
Timestamp:
Sep 25, 2013, 8:55:43 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • Modification to 3.1 branch to make it extremely similar to 3.0. What remains are function rewrite with allocation in the function and desallocation outside of the function. Will be next step
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/mondo/src/common/newt-specific.c

    r3161 r3190  
    122122
    123123        /*@ buffers ********************************************************** */
    124         int i;
    125         char *tmp;
     124        int i = 0;
     125        char *tmp = NULL;
    126126
    127127        assert_string_is_neither_NULL_nor_zerolength(prompt);
     
    173173        int i;
    174174
     175        assert_string_is_neither_NULL_nor_zerolength(prompt);
    175176        if (g_fail_immediately) {
    176177            // We consider the user aborted by using the -F option
     
    326327        paranoid_system("killall mindi 2> /dev/null");
    327328        kill_anything_like_this("/mondo/do-not");
    328         kill_anything_like_this("tmp.mondo");
     329        kill_anything_like_this("mondo.tmp");
    329330        kill_anything_like_this("ntfsclone");
    330331        sync();
     
    420421        free_newt_stuff();
    421422        if (!g_text_mode) {
    422             log_msg(1, "Calling newtFinished()");
    423             newtFinished();
     423            if (does_file_exist("/THIS-IS-A-RAMDISK")) {
     424                log_msg(1, "Calling newtFinished()");
     425                newtFinished();
     426            } else {
     427                log_msg(1, "Calling newtSuspend()");
     428                newtSuspend();
     429            }
    424430        }
    425431        printf("Execution run ended; result=%d\n", signal);
     
    440446        char *command = NULL;
    441447        char *tmp = NULL;
     448        char *p = NULL;
    442449
    443450        /*@ pointers ********************************************************* */
     
    465472                for (err_log_lines[i][0] = '\0';
    466473                     strlen(err_log_lines[i]) < 2 && !feof(fin);) {
    467                     if (fgets(err_log_lines[i], MAX_NEWT_COMMENT_LEN, fin)) {
    468                         //FIXME
     474                    p = fgets(err_log_lines[i], MAX_NEWT_COMMENT_LEN, fin);
     475                    if (!p) {
     476                        // FIXME
    469477                    }
    470478                    /* Commented to make valgrind happy and avoid crash
     
    571579
    572580        /*@ buffers ********************************************************* */
    573         char *title = NULL;
    574581        char *tmp = NULL;
    575582
     
    580587        assert(ttl != NULL);
    581588        malloc_string(tmp);
    582         mr_asprintf(title, "%s", ttl);
    583         strcpy(g_isoform_header_str, title);
    584         if (g_text_mode) {
    585             log_msg(0, title);
    586         } else {
    587             strcpy(tmp, title);
     589        strcpy(g_isoform_header_str, ttl);
     590        if (g_text_mode) {
     591            log_msg(0, ttl);
     592        } else {
     593            strcpy(tmp, ttl);
    588594            center_string(tmp, 80);
    589595            newtPushHelpLine(tmp);
     
    596602            g_isoform_header = newtLabel(1, 1, g_isoform_header_str);
    597603            g_isoform_scale = newtScale(3, 3, 34, 100);
    598             newtCenteredWindow(40, 7, title);
     604            newtCenteredWindow(40, 7, ttl);
    599605            g_isoform_main = newtForm(NULL, NULL, 0);
    600606            g_isoform_timeline = newtLabel(1, 5, "                    ");
     
    607613        }
    608614        update_evalcall_form(0);
    609         mr_free(title);
    610615        paranoid_free(tmp);
    611616    }
     
    971976                }
    972977                if (percentage >= 3) {
    973                     mr_strcat(taskprogress, "] %3d%% done; %2ld:%02ld to go", percentage, time_remaining / 60, time_remaining % 60);
     978                    mr_strcat(taskprogress, "] %3d%% done; %2ld:%02ld to go", percentage, (long) time_remaining / 60, (long) time_remaining % 60);
    974979                    printf("---evalcall---1--- %s\n", g_isoform_header_str);
    975980                    printf("---evalcall---2--- %s\n", taskprogress);
     
    12251230        mr_free(title_sz);
    12261231        mr_free(minimsg_sz);
    1227         paranoid_free(outstr);
    12281232        return (output);
    12291233    }
     
    13691373        log_msg(2, "Loading %s", source_file);
    13701374        for (filelist->entries = 0; filelist->entries <= ARBITRARY_MAXIMUM; ) {
    1371             if (tmp != NULL) {
    1372                 mr_free(tmp);
    1373             }
     1375            mr_free(tmp);
    13741376            if (feof(fin)) {
    13751377                break;
     
    15681570            }
    15691571        }
    1570 
    15711572        newtFormDestroy(myForm);
    15721573        newtPopWindow();
Note: See TracChangeset for help on using the changeset viewer.