better use of fn_format() in ha_mysisam::restore() and ha_myisam::backup()

fixed buffer overflow in fn_format()


mysys/mf_format.c:
  fixed coredump when dsk overflows
sql/ha_myisam.cc:
  switched from my own pointer black magic in forming a file name to use
  the functionionality of fn_format()
This commit is contained in:
unknown 2000-09-18 22:10:06 -06:00
commit 904655e6d2
2 changed files with 11 additions and 26 deletions

View file

@ -53,7 +53,8 @@ my_string fn_format(my_string to, const char *name, const char *dsk,
name+=(length=dirname_part(dev,(startpos=(my_string) name)));
if (length == 0 || flag & 1)
{
(void) strmov(dev,dsk); /* Use given directory */
(void) strnmov(dev,dsk, sizeof(dev) - 2);
/* Use given directory */
convert_dirname(dev); /* Fix to this OS */
}
if (flag & 8)