diff options
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r-- | sql/ha_innodb.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 4835f794a1d..4a50e2d8ccf 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -395,12 +395,9 @@ innobase_mysql_print_thd( but better be safe */ } - for (i = 0; i < len && s[i]; i++); - - memcpy(buf, s, i); /* Use memcpy to reduce the timeframe - for a race, compared to fwrite() */ - buf[300] = '\0'; /* not needed, just extra safety */ - + /* Use strmake to reduce the timeframe + for a race, compared to fwrite() */ + i= (uint) (strmake(buf, s, len) - buf); putc('\n', f); fwrite(buf, 1, i, f); } |