From 64ae333863d61a9a38aed1808ff2b61591685919 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 22 Feb 2007 09:49:18 +0000 Subject: [PATCH] Macro for length of rejection reasons string (old size is still safe) --- cdrskin/cdrskin.c | 2 +- cdrskin/cdrskin_timestamp.h | 2 +- libburn/async.c | 2 +- libburn/libburn.h | 13 +++++++++++-- libburn/options.c | 2 +- libburn/write.c | 2 +- test/libburner.c | 2 +- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/cdrskin/cdrskin.c b/cdrskin/cdrskin.c index b84174f..06aa9eb 100644 --- a/cdrskin/cdrskin.c +++ b/cdrskin/cdrskin.c @@ -4359,7 +4359,7 @@ int Cdrskin_activate_write_mode(struct CdrskiN *skin, int flag) { int profile_number= -1, current_is_cd= 1, ret, was_still_default= 0; - char profile_name[80], reasons[1024]; + char profile_name[80], reasons[BURN_REASONS_LEN]; enum burn_disc_status s= BURN_DISC_UNGRABBED; enum burn_write_types wt; diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index c5e6fa9..61cd620 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.02.22.073157" +#define Cdrskin_timestamP "2007.02.22.094939" diff --git a/libburn/async.c b/libburn/async.c index a562087..3ae2358 100644 --- a/libburn/async.c +++ b/libburn/async.c @@ -333,7 +333,7 @@ static void *write_disc_worker_func(struct w_list *w) void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc) { struct write_opts o; - char reasons[1024+80]; + char reasons[BURN_REASONS_LEN+80]; #ifndef Libburn_precheck_write_ruleS int i, j, mode, mixed_mode = 0; #endif diff --git a/libburn/libburn.h b/libburn/libburn.h index ffb8fe6..06cdf45 100644 --- a/libburn/libburn.h +++ b/libburn/libburn.h @@ -998,6 +998,14 @@ int burn_disc_get_format_descr(struct burn_drive *drive, int index, void burn_disc_read(struct burn_drive *drive, const struct burn_read_opts *o); + +/* ts A70222 */ +/** The length of a rejection reasons string for burn_precheck_write() and + burn_write_opts_auto_write_type() . +*/ +#define BURN_REASONS_LEN 4096 + + /* ts A70219 */ /** Examines a completed setup for burn_disc_write() wether it is permissible with drive and media. This function is called by burn_disc_write() but @@ -1009,7 +1017,7 @@ void burn_disc_read(struct burn_drive *drive, const struct burn_read_opts *o); @return 1 ok, -1= no recordable media detected, 0= other failure */ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc, - char reasons[1024], int silent); + char reasons[BURN_REASONS_LEN], int silent); /* <<< enabling switch for internal usage and trust in this function */ #define Libburn_precheck_write_ruleS 1 @@ -1266,6 +1274,7 @@ int burn_write_opts_set_write_type(struct burn_write_opts *opts, enum burn_write_types write_type, int block_type); + /* ts A70207 */ /** As an alternative to burn_write_opts_set_write_type() this function tries to find a suitable write type and block type for a given write job @@ -1282,7 +1291,7 @@ int burn_write_opts_set_write_type(struct burn_write_opts *opts, */ enum burn_write_types burn_write_opts_auto_write_type( struct burn_write_opts *opts, struct burn_disc *disc, - char reasons[1024], int flag); + char reasons[BURN_REASONS_LEN], int flag); /** Supplies toc entries for writing - not normally required for cd mastering diff --git a/libburn/options.c b/libburn/options.c index b4363d1..b4f3555 100644 --- a/libburn/options.c +++ b/libburn/options.c @@ -179,7 +179,7 @@ void burn_write_opts_set_start_byte(struct burn_write_opts *opts, off_t value) */ enum burn_write_types burn_write_opts_auto_write_type( struct burn_write_opts *opts, struct burn_disc *disc, - char reasons[1024], int flag) + char reasons[BURN_REASONS_LEN], int flag) { struct burn_multi_caps *caps = NULL; struct burn_drive *d = opts->drive; diff --git a/libburn/write.c b/libburn/write.c index 5a8de2f..be20d5d 100644 --- a/libburn/write.c +++ b/libburn/write.c @@ -1252,7 +1252,7 @@ int burn_disc_setup_dvd_minus_r(struct burn_write_opts *o, /* ts A70219 : API */ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc, - char reasons[1024], int silent) + char reasons[BURN_REASONS_LEN], int silent) { enum burn_write_types wt; struct burn_drive *d = o->drive; diff --git a/test/libburner.c b/test/libburner.c index 61797cc..6ce437e 100644 --- a/test/libburner.c +++ b/test/libburner.c @@ -373,7 +373,7 @@ int libburner_payload(struct burn_drive *drive, time_t start_time; int last_sector = 0, padding = 0, trackno, unpredicted_size = 0, fd; off_t fixed_size; - char *adr, reasons[1024]; + char *adr, reasons[BURN_REASONS_LEN]; struct stat stbuf; if (all_tracks_type != BURN_AUDIO) {