summaryrefslogtreecommitdiff
path: root/client/mysqltest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r--client/mysqltest.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 5415b653615..7bc52941700 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -1654,12 +1654,12 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename)
{
int fd;
size_t len;
- char buff[512];
+ char buff[16384];
if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
return 1;
while((len= my_read(fd, (uchar*)&buff,
- sizeof(buff), MYF(0))) > 0)
+ sizeof(buff)-1, MYF(0))) > 0)
{
char *p= buff, *start= buff;
while (p < buff+len)
@@ -1670,7 +1670,8 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename)
/* Add fake newline instead of cr and output the line */
*p= '\n';
p++; /* Step past the "fake" newline */
- dynstr_append_mem(ds, start, p-start);
+ *p= 0;
+ replace_dynstr_append_mem(ds, start, p-start);
p++; /* Step past the "fake" newline */
start= p;
}
@@ -1678,7 +1679,8 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename)
p++;
}
/* Output any chars that migh be left */
- dynstr_append_mem(ds, start, p-start);
+ *p= 0;
+ replace_dynstr_append_mem(ds, start, p-start);
}
my_close(fd, MYF(0));
return 0;