"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/parse_options.c" between
detox-1.4.0.tar.gz and detox-1.4.1.tar.gz

About: Detox is a utility designed to clean up filenames, especially those created on other operating systems.

parse_options.c  (detox-1.4.0):parse_options.c  (detox-1.4.1)
skipping to change at line 258 skipping to change at line 258
if (main_options->list_sequences) { if (main_options->list_sequences) {
/* /*
* Early Retirement * Early Retirement
*/ */
return main_options; return main_options;
} }
main_options->files = malloc(sizeof(char *) * 10); main_options->files = malloc(sizeof(char *) * 10);
i = 0; i = 0;
max = 0; max = 10;
if (optind < argc) { if (optind < argc) {
while (optind < argc) { while (optind < argc) {
main_options->files[i++] = strdup(argv[optind]); /* not enough space for the next file and
if (i > max) { possible ending NULL -> realloc */
if (i + 2 > max) {
main_options->files = realloc(main_options->files , sizeof(char *) * (10 + max)); main_options->files = realloc(main_options->files , sizeof(char *) * (10 + max));
max += 10; max += 10;
} }
main_options->files[i++] = strdup(argv[optind]);
optind++; optind++;
} }
main_options->files[i] = NULL; main_options->files[i] = NULL;
} }
else if (!main_options->is_inline_mode) { else if (!main_options->is_inline_mode) {
printf("%s", !main_options->is_inline_bin ? usage_message : printf("%s", !main_options->is_inline_bin ? usage_message :
usage_message_inline); usage_message_inline);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added

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