summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-08-14 21:10:27 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-08-14 21:10:27 +0000
commitc347f572c0d1dbd4f38c5cce861bccaa7aaa2ccd (patch)
tree080bb0f3c811f35b713586fbf2280cb4bcb5d621 /numpy/core/src/arrayobject.c
parentc3fc219b92e76a169b84824a7f56287208e0deb1 (diff)
downloadnumpy-c347f572c0d1dbd4f38c5cce861bccaa7aaa2ccd.tar.gz
Remove strnlen and fix unicode copy and strip
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index f1c8b6b9b..f0fea6a04 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -4195,7 +4195,7 @@ _mystrncmp(char *s1, char *s2, int len1, int len2)
static void _rstripw(char *s, int n)
{
int i;
- for(i=strnlen(s,n)-1; i>=1; i--) /* Never strip to length 0. */
+ for(i=n-1; i>=1; i--) /* Never strip to length 0. */
{
int c = s[i];
if (!c || isspace(c))
@@ -4245,8 +4245,8 @@ _char_release(char *ptr, int nc)
static char *
_uni_copy_n_strip(char *original, char *temp, int nc)
{
- if (nc*4 > SMALL_STRING) {
- temp = malloc(nc);
+ if (nc*sizeof(PyArray_UCS4) > SMALL_STRING) {
+ temp = malloc(nc*sizeof(PyArray_UCS4));
if (!temp) {
PyErr_NoMemory();
return NULL;