From 9747d0aa7298784664f459d6382ee6be73961bbf Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 28 Mar 2011 12:03:20 +1100 Subject: move variable declarations to start of block, fixing builds on Windows and other strict compilers. Patch from rasjidw AT gmail.com --- bcrypt/bcrypt_python.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bcrypt/bcrypt_python.c b/bcrypt/bcrypt_python.c index b505c3b..a2d99d2 100644 --- a/bcrypt/bcrypt_python.c +++ b/bcrypt/bcrypt_python.c @@ -68,13 +68,15 @@ bcrypt_hashpw(PyObject *self, PyObject *args, PyObject *kw_args) static char *keywords[] = { "password", "salt", NULL }; char *password = NULL, *salt = NULL; char *ret; + char *password_copy; + char *salt_copy; if (!PyArg_ParseTupleAndKeywords(args, kw_args, "ss:hashpw", keywords, &password, &salt)) return NULL; - char *password_copy = strdup(password); - char *salt_copy = strdup(salt); + password_copy = strdup(password); + salt_copy = strdup(salt); Py_BEGIN_ALLOW_THREADS; ret = pybc_bcrypt(password_copy, salt_copy); -- cgit v1.2.1