"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mpartition.c" between
mtools-4.0.35.tar.bz2 and mtools-4.0.36.tar.bz2

About: Mtools is a collection of utilities to access MS-DOS disks from Unix without mounting them.

mpartition.c  (mtools-4.0.35.tar.bz2):mpartition.c  (mtools-4.0.36.tar.bz2)
skipping to change at line 380 skipping to change at line 380
case 'v': case 'v':
verbose++; verbose++;
break; break;
case 'b': case 'b':
begin_set = 1; begin_set = 1;
begin = strtoui(optarg, &endptr, 0); begin = strtoui(optarg, &endptr, 0);
break; break;
case 'l': case 'l':
size_set = 1; size_set = 1;
length = strtoui(optarg, &endptr, 0); length = parseSize(optarg);
break; break;
default: default:
usage(1); usage(1);
} }
check_number_parse_errno((char)c, optarg, endptr); check_number_parse_errno((char)c, optarg, endptr);
} }
if (argc - optind != 1 || if (argc - optind != 1 ||
!argv[optind][0] || argv[optind][1] != ':') !argv[optind][0] || argv[optind][1] != ':')
skipping to change at line 443 skipping to change at line 443
"init: open: %s", strerror(errno)); "init: open: %s", strerror(errno));
#else #else
sprintf(errmsg,"init: open: %s", strerror(errno)); sprintf(errmsg,"init: open: %s", strerror(errno));
#endif #endif
continue; continue;
} }
tot_sectors = used_dev.tot_sectors; tot_sectors = used_dev.tot_sectors;
/* read the partition table */ /* read the partition table */
if (READS(Stream, (char *) buf, 0, 512) != 512 && !initialize){ if (PREADS(Stream, (char *) buf, 0, 512) != 512 && !initialize){
#ifdef HAVE_SNPRINTF #ifdef HAVE_SNPRINTF
snprintf(errmsg, sizeof(errmsg)-1, snprintf(errmsg, sizeof(errmsg)-1,
"Error reading from '%s', wrong parameters?", "Error reading from '%s', wrong parameters?",
name); name);
#else #else
sprintf(errmsg, sprintf(errmsg,
"Error reading from '%s', wrong parameters?", "Error reading from '%s', wrong parameters?",
name); name);
#endif #endif
continue; continue;
skipping to change at line 672 skipping to change at line 672
printf("mpartition -c -b %d -l %d -t %d -h %d -s %d -b %u %c:\n", printf("mpartition -c -b %d -l %d -t %d -h %d -s %d -b %u %c:\n",
BEGIN(tpartition), PART_SIZE(tpartition), BEGIN(tpartition), PART_SIZE(tpartition),
used_dev.tracks, used_dev.heads, used_dev.sectors, used_dev.tracks, used_dev.heads, used_dev.sectors,
BEGIN(tpartition), drive); BEGIN(tpartition), drive);
} }
if(dirty) { if(dirty) {
/* write data back to the disk */ /* write data back to the disk */
if(verbose>=2) if(verbose>=2)
print_sector("Writing sector", buf, 512); print_sector("Writing sector", buf, 512);
if (WRITES(Stream, (char *) buf, 0, 512) != 512) { if (PWRITES(Stream, (char *) buf, 0, 512) != 512) {
fprintf(stderr,"Error writing partition table"); fprintf(stderr,"Error writing partition table");
exit(1); exit(1);
} }
if(verbose>=3) if(verbose>=3)
print_sector("Sector written", buf, 512); print_sector("Sector written", buf, 512);
} }
FREE(&Stream); FREE(&Stream);
exit(0); exit(0);
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)