diff options
author | Damien Miller <djm@mindrot.org> | 2011-03-28 12:03:20 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2011-03-28 12:03:20 +1100 |
commit | 9747d0aa7298784664f459d6382ee6be73961bbf (patch) | |
tree | 6217a84749bf3f94e886c7efab25b8cda69a318b | |
parent | 251a9c50546cc352d5378365678da176cf26c2d3 (diff) | |
download | py-bcrypt-9747d0aa7298784664f459d6382ee6be73961bbf.tar.gz |
move variable declarations to start of block, fixing builds on Windows and
other strict compilers. Patch from rasjidw AT gmail.com
-rw-r--r-- | bcrypt/bcrypt_python.c | 6 |
1 files 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); |