Changeset 2334 in MondoRescue for branches/2.2.10/mondo/src/common/newt-specific.c
- Timestamp:
- Aug 18, 2009, 5:28:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/newt-specific.c
r2331 r2334 345 345 log_msg(0, "-------FATAL ERROR---------"); 346 346 log_msg(0, error_string); 347 newtFinished();348 347 } 349 348 … … 395 394 } 396 395 if (!g_text_mode) { 397 if (does_file_exist("/THIS-IS-A-RAMDISK")) { 398 log_msg(1, "Calling newtFinished()"); 399 newtFinished(); 400 } else { 401 log_msg(1, "Calling newtSuspend()"); 402 newtSuspend(); 403 } 396 log_msg(1, "Calling newtFinished()"); 397 newtFinished(); 404 398 } 405 399 printf("Execution run ended; result=%d\n", signal); … … 444 438 445 439 /*@ buffers ********************************************************** */ 446 char *command ;447 char *tmp ;440 char *command = NULL; 441 char *tmp = NULL; 448 442 449 443 /*@ pointers ********************************************************* */ … … 453 447 int i = 0; 454 448 455 malloc_string(command);456 malloc_string(tmp);457 449 assert_string_is_neither_NULL_nor_zerolength(filename); 458 450 assert(grep_for_me != NULL); 459 451 460 452 if (!does_file_exist(filename)) { 461 paranoid_free(command);462 paranoid_free(tmp);463 453 return; 464 454 } 465 455 if (grep_for_me[0] != '\0') { 466 sprintf(command, "grep '%s' %s | tail -n%d", 467 grep_for_me, filename, g_noof_log_lines); 468 } else { 469 sprintf(command, "tail -n%d %s", g_noof_log_lines, 470 filename); 456 mr_asprintf(command, "grep '%s' %s | tail -n%d", grep_for_me, filename, g_noof_log_lines); 457 } else { 458 mr_asprintf(command, "tail -n%d %s", g_noof_log_lines, filename); 471 459 } 472 460 fin = popen(command, "r"); … … 483 471 */ 484 472 if (!strncmp(err_log_lines[i], "root:", 5)) { 485 strcpy(tmp, err_log_lines[i] + 6);473 mr_asprintf(tmp, "%s", err_log_lines[i] + 6); 486 474 strcpy(err_log_lines[i], tmp); 475 mr_free(tmp); 487 476 } 488 477 if (feof(fin)) { … … 493 482 paranoid_pclose(fin); 494 483 } 484 mr_free(command); 495 485 refresh_log_screen(); 496 paranoid_free(command);497 paranoid_free(tmp);498 486 } 499 487 … … 584 572 585 573 /*@ buffers ********************************************************* */ 586 char *title ;587 char *tmp ;574 char *title = NULL; 575 char *tmp = NULL; 588 576 589 577 /*@ initialize ****************************************************** */ 590 578 g_isoform_old_progress = -1; 591 579 g_mysterious_dot_counter = 0; 592 malloc_string(title); 580 581 assert(ttl != NULL); 593 582 malloc_string(tmp); 594 595 assert(ttl != NULL); 596 strcpy(title, ttl); 583 mr_asprintf(title, "%s", ttl); 597 584 strcpy(g_isoform_header_str, title); 598 585 if (g_text_mode) { … … 620 607 } 621 608 update_evalcall_form(0); 609 mr_free(title); 622 610 paranoid_free(tmp); 623 paranoid_free(title);624 611 } 625 612 … … 641 628 /*@ buffers ********************************************************* */ 642 629 char *b1c; 643 char *blurb1 ;644 char *blurb2 ;645 char *blurb3 ;630 char *blurb1 = NULL; 631 char *blurb2 = NULL; 632 char *blurb3 = NULL; 646 633 647 634 /*@ initialize ****************************************************** */ 648 635 g_mysterious_dot_counter = 0; 649 636 650 malloc_string(b1c);651 637 malloc_string(blurb1); 652 638 malloc_string(blurb2); 653 639 malloc_string(blurb3); 640 malloc_string(b1c); 654 641 655 642 assert(title != NULL); … … 658 645 assert(b3 != NULL); 659 646 660 strcpy(blurb1, b1);661 strcpy(blurb2, b2);662 strcpy(blurb3, b3);647 strcpy(blurb1, b1); 648 strcpy(blurb2, b2); 649 strcpy(blurb3, b3); 663 650 strcpy(b1c, b1); 664 651 center_string(b1c, 80); … … 695 682 update_progress_form_full(blurb1, blurb2, blurb3); 696 683 paranoid_free(b1c); 697 paranoid_free(blurb1);698 paranoid_free(blurb2);699 paranoid_free(blurb3);684 mr_free(blurb1); 685 mr_free(blurb2); 686 mr_free(blurb3); 700 687 } 701 688 … … 1176 1163 1177 1164 /*@ newt ************************************************************ */ 1178 char *title_sz ;1179 char *minimsg_sz ;1165 char *title_sz = NULL; 1166 char *minimsg_sz = NULL; 1180 1167 static t_bkptype possible_bkptypes[] = 1181 1168 { none, cdr, cdrw, dvd, tape, cdstream, udev, nfs, iso }; … … 1198 1185 newtComponent myForm; 1199 1186 1200 title_sz = malloc(MAX_NEWT_COMMENT_LEN);1201 minimsg_sz = malloc(MAX_NEWT_COMMENT_LEN);1202 1187 outstr = malloc(MAX_NEWT_COMMENT_LEN); 1203 1188 if (g_text_mode) { … … 1217 1202 } 1218 1203 } 1219 paranoid_free(title_sz);1220 paranoid_free(minimsg_sz);1221 1204 paranoid_free(outstr); 1222 1205 return (backup_type); … … 1224 1207 newtDrawRootText(18, 0, WELCOME_STRING); 1225 1208 if (restoring) { 1226 strcpy(title_sz, 1227 "Please choose the backup media from which you want to read data."); 1228 strcpy(minimsg_sz, "Read from:"); 1229 } else { 1230 strcpy(title_sz, 1231 "Please choose the backup media to which you want to archive data."); 1232 strcpy(minimsg_sz, "Backup to:"); 1209 mr_asprintf(title_sz, "Please choose the backup media from which you want to read data."); 1210 mr_asprintf(minimsg_sz, "Read from:"); 1211 } else { 1212 mr_asprintf(title_sz, "Please choose the backup media to which you want to archive data."); 1213 mr_asprintf(minimsg_sz, "Backup to:"); 1233 1214 } 1234 1215 newtPushHelpLine(title_sz); … … 1266 1247 } 1267 1248 newtPopHelpLine(); 1268 paranoid_free(title_sz);1269 paranoid_free(minimsg_sz);1249 mr_free(title_sz); 1250 mr_free(minimsg_sz); 1270 1251 paranoid_free(outstr); 1271 1252 return (output);
Note:
See TracChangeset
for help on using the changeset viewer.