mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed during review of new pulled code
extra/perror.c: Use strmov() instead of strcpy() Indentation fixes sql/sql_table.cc: Revert back part of the old code as the new code didn't use mysql_data_home, which would have caused problems in the embedded server sql/sql_update.cc: Ensure that used_index is always set (It has to be set because it's value is tested if order != 0)
This commit is contained in:
@ -213,12 +213,14 @@ int main(int argc,char *argv[])
|
||||
string 'Unknown Error'. To avoid printing it we try to find the
|
||||
error string by asking for an impossible big error message.
|
||||
*/
|
||||
msg = strerror(10000);
|
||||
msg= strerror(10000);
|
||||
|
||||
/* allocate a buffer for unknown_error since strerror always returns the same pointer
|
||||
on some platforms such as Windows */
|
||||
unknown_error = malloc( strlen(msg)+1 );
|
||||
strcpy( unknown_error, msg );
|
||||
/*
|
||||
Allocate a buffer for unknown_error since strerror always returns
|
||||
the same pointer on some platforms such as Windows
|
||||
*/
|
||||
unknown_error= malloc(strlen(msg)+1);
|
||||
strmov(unknown_error, msg);
|
||||
|
||||
for ( ; argc-- > 0 ; argv++)
|
||||
{
|
||||
@ -271,7 +273,7 @@ int main(int argc,char *argv[])
|
||||
|
||||
/* if we allocated a buffer for unknown_error, free it now */
|
||||
if (unknown_error)
|
||||
free(unknown_error);
|
||||
free(unknown_error);
|
||||
|
||||
exit(error);
|
||||
return error;
|
||||
|
Reference in New Issue
Block a user