git.samba.org
/
jelmer
/
subvertpy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4fb41f
)
Use length for string when it is known.
author
Jelmer Vernooij
<jelmer@jelmer.uk>
Wed, 23 May 2018 19:05:07 +0000
(20:05 +0100)
committer
Jelmer Vernooij
<jelmer@jelmer.uk>
Wed, 23 May 2018 19:05:07 +0000
(20:05 +0100)
subvertpy/util.c
patch
|
blob
|
history
diff --git
a/subvertpy/util.c
b/subvertpy/util.c
index 7536f613abc29765afaddf97df022b13a4c54abc..af16aecd4eac44d85b89b94179b245c7e65fbd25 100644
(file)
--- a/
subvertpy/util.c
+++ b/
subvertpy/util.c
@@
-503,7
+503,7
@@
PyObject *prop_hash_to_dict(apr_hash_t *props)
py_key = Py_None;
Py_INCREF(py_key);
} else {
- py_key = Py
Bytes
_FromStringAndSize(key, klen);
+ py_key = Py
Unicode
_FromStringAndSize(key, klen);
}
if (PyDict_SetItem(py_props, py_key, py_val) != 0) {
Py_DECREF(py_key);
@@
-1160,7
+1160,7
@@
PyObject *dirent_hash_to_dict(apr_hash_t *dirents, unsigned int dirent_fields, a
pykey = Py_None;
Py_INCREF(pykey);
} else {
- pykey = PyUnicode_FromString
((char *)key
);
+ pykey = PyUnicode_FromString
AndSize(key, klen
);
}
if (PyDict_SetItem(py_dirents, pykey, item) != 0) {
Py_DECREF(item);