Changeset 3060 in MondoRescue for branches/3.0/mondo/src/common/newt-specific.c
- Timestamp:
- Nov 10, 2012, 5:05:37 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/common/newt-specific.c
r2982 r3060 123 123 /*@ buffers ********************************************************** */ 124 124 int i; 125 char *p; 125 126 126 127 assert_string_is_neither_NULL_nor_zerolength(prompt); … … 132 133 133 134 while (1) { 134 system("sync");135 paranoid_system("sync"); 135 136 printf 136 137 ("---promptdialogYN---1--- %s\n---promptdialogYN---Q--- [yes] [no] ---\n--> ", 137 138 prompt); 138 (void) fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin); 139 p= fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin); 140 if (!p) { 141 //FIXME 142 } 139 143 if (tmp[strlen(tmp) - 1] == '\n') 140 144 tmp[strlen(tmp) - 1] = '\0'; … … 151 155 return (FALSE); 152 156 } else { 153 system("sync");157 paranoid_system("sync"); 154 158 printf 155 159 ("Please enter either YES or NO (or yes or no, or y or n, or...)\n"); … … 172 176 /*@ buffer *********************************************************** */ 173 177 char *tmp; 178 char *p; 174 179 int i; 175 180 … … 177 182 assert_string_is_neither_NULL_nor_zerolength(prompt); 178 183 if (g_text_mode) { 179 system("sync");184 paranoid_system("sync"); 180 185 printf 181 186 ("---promptdialogOKC---1--- %s\n---promptdialogOKC---Q--- [OK] [Cancel] ---\n--> ", 182 187 prompt); 183 (void) fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin); 188 p = fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin); 189 if (!p) { 190 // FIXME 191 } 184 192 if (tmp[strlen(tmp) - 1] == '\n') 185 193 tmp[strlen(tmp) - 1] = '\0'; … … 347 355 */ 348 356 349 chdir("/"); 357 if (chdir("/")) { 358 // FIXME 359 } 350 360 if (g_selfmounted_isodir) { 351 361 sprintf(command, "umount -d %s", g_selfmounted_isodir); … … 406 416 407 417 /* Before removing dir, make sure we're out of them */ 408 chdir("/tmp"); 418 if (chdir("/tmp")) { 419 // FIXME 420 } 409 421 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 410 422 if (g_selfmounted_isodir) { … … 432 444 log_msg(8,"erasing tempdir %s",bkpinfo->tmpdir); 433 445 mr_asprintf(&command, "rm -Rf %s", bkpinfo->tmpdir); 434 system(command);446 paranoid_system(command); 435 447 mr_free(command); 436 448 } … … 441 453 log_msg(8,"erasing scratchdir %s",bkpinfo->scratchdir); 442 454 mr_asprintf(&command, "rm -Rf %s", bkpinfo->scratchdir); 443 system(command);455 paranoid_system(command); 444 456 mr_free(command); 445 457 } … … 475 487 char *command = NULL; 476 488 char *tmp = NULL; 489 char *p = NULL; 477 490 478 491 /*@ pointers ********************************************************* */ … … 502 515 for (err_log_lines[i][0] = '\0'; 503 516 strlen(err_log_lines[i]) < 2 && !feof(fin);) { 504 (void) fgets(err_log_lines[i], MAX_NEWT_COMMENT_LEN, 505 fin); 517 p = fgets(err_log_lines[i], MAX_NEWT_COMMENT_LEN, fin); 518 if (!p) { 519 // FIXME 520 } 506 521 /* Commented to make valgrind happy and avoid crash 507 522 strip_spaces(err_log_lines[i]); … … 774 789 /*@ buffers ********************************************************** */ 775 790 char *blurb; 791 char *p; 776 792 char *original_contents; 777 793 … … 786 802 ("---promptstring---1--- %s\n---promptstring---2--- %s\n---promptstring---Q---\n--> ", 787 803 title, b); 788 (void) fgets(output, maxsize, stdin); 804 p = fgets(output, maxsize, stdin); 805 if (!p) { 806 // FIXME 807 } 789 808 if (output[strlen(output) - 1] == '\n') 790 809 output[strlen(output) - 1] = '\0'; … … 843 862 /*@ buffers *********************************************************** */ 844 863 char *prompt; 864 char *q; 845 865 846 866 /*@ newt ************************************************************** */ … … 865 885 || strcmp(prompt, button2));) { 866 886 printf("--> "); 867 (void) fgets(prompt, MAX_NEWT_COMMENT_LEN, stdin); 887 q = fgets(prompt, MAX_NEWT_COMMENT_LEN, stdin); 888 if (!q) { 889 // FIXME 890 } 868 891 } 869 892 if (!strcmp(prompt, button1)) { … … 1276 1299 "netfs", "iso", NULL }; 1277 1300 char *outstr; 1301 char *p; 1278 1302 t_bkptype backup_type; 1279 1303 int i; … … 1301 1325 } 1302 1326 printf(")\n--> "); 1303 (void) fgets(outstr, MAX_NEWT_COMMENT_LEN, stdin); 1327 p = fgets(outstr, MAX_NEWT_COMMENT_LEN, stdin); 1328 if (!p) { 1329 // FIXME 1330 } 1304 1331 strip_spaces(outstr); 1305 1332 for (i = 0; possible_responses[i]; i++) { … … 1484 1511 bool done; 1485 1512 char *tmp; 1513 char *p; 1486 1514 char *tmp1 = NULL; 1487 1515 FILE *fin, *fout; … … 1513 1541 break; 1514 1542 } 1515 (void) fgets(tmp, MAX_NEWT_COMMENT_LEN, fin); 1543 p = fgets(tmp, MAX_NEWT_COMMENT_LEN, fin); 1544 if (!p) { 1545 // FIXME 1546 } 1516 1547 i = (int) strlen(tmp); 1517 1548 if (i < 2) {
Note:
See TracChangeset
for help on using the changeset viewer.