summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-02-03 13:18:30 +0200
committermonty@mysql.com <>2005-02-03 13:18:30 +0200
commit422c2eb868036e8741c4e6d62d7267930c4e69bd (patch)
treee52c0cca0b1936bb8b6332b6f0e724b9666f65f1 /extra
parent12bf600d18b98a8d82167e21a2904ca40071dd75 (diff)
parente7450d9781781666503837d748cf313e3f406f59 (diff)
downloadmariadb-git-422c2eb868036e8741c4e6d62d7267930c4e69bd.tar.gz
4.1 -> 5.0 merge
Diffstat (limited to 'extra')
-rw-r--r--extra/perror.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/extra/perror.c b/extra/perror.c
index 3e920ac50a4..b377b360b5c 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -218,12 +218,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++)
{
@@ -276,7 +278,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;