summaryrefslogtreecommitdiff
path: root/mysys/default_modify.c
diff options
context:
space:
mode:
authorunknown <petr@mysql.com>2005-06-29 13:27:27 +0400
committerunknown <petr@mysql.com>2005-06-29 13:27:27 +0400
commitd9e54b04c5e3dd73e60a31a313a74975aebf4995 (patch)
tree40794c12c849231663b391dfe4d296c107acc918 /mysys/default_modify.c
parente29f5221973ad7bf48f0e4152c5bb8a4491de7c1 (diff)
downloadmariadb-git-d9e54b04c5e3dd73e60a31a313a74975aebf4995.tar.gz
post review fixes (second review)
mysys/default_modify.c: post review fixes
Diffstat (limited to 'mysys/default_modify.c')
-rw-r--r--mysys/default_modify.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mysys/default_modify.c b/mysys/default_modify.c
index e2bc12a2c95..ea384f9f27a 100644
--- a/mysys/default_modify.c
+++ b/mysys/default_modify.c
@@ -71,7 +71,7 @@ int modify_defaults_file(const char *file_location, const char *option,
uint opt_len, optval_len, sect_len, nr_newlines= 0, buffer_size;
my_bool in_section= FALSE, opt_applied= 0;
uint reserve_extended= 1, old_opt_len= 0;
- uint new_opt_len= opt_len + 1 + optval_len + NEWLINE_LEN;
+ uint new_opt_len;
int reserve_occupied= 0;
DBUG_ENTER("modify_defaults_file");
@@ -80,11 +80,13 @@ int modify_defaults_file(const char *file_location, const char *option,
/* my_fstat doesn't use the flag parameter */
if (my_fstat(fileno(cnf_file), &file_stat, MYF(0)))
- goto err;
+ goto malloc_err;
opt_len= (uint) strlen(option);
optval_len= (uint) strlen(option_value);
+ new_opt_len= opt_len + 1 + optval_len + NEWLINE_LEN;
+
/* calculate the size of the buffer we need */
buffer_size= sizeof(char) * (file_stat.st_size +
/* option name len */