summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-01-01 09:28:16 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-01-01 09:28:16 +0000
commit9fb2c30a12ae191051ee3f3e71d74dda9cdfae81 (patch)
tree998955807907c5d4d1d57597d263c24aff1cbeb7 /numpy
parentcd308e4be7873cd0d8f07bea9f79545092dac0f3 (diff)
downloadnumpy-9fb2c30a12ae191051ee3f3e71d74dda9cdfae81.tar.gz
Do not use strncpy but strcpy: we know the string sizes, and strncpy sucks anyway.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/npy_format.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/npy_format.c b/numpy/core/src/npy_format.c
index 3038567c2..d575996a8 100644
--- a/numpy/core/src/npy_format.c
+++ b/numpy/core/src/npy_format.c
@@ -260,20 +260,20 @@ _fix_ascii_format(char* buf, size_t buflen, int decimal)
if (buf_size < 4) { \
return NULL; \
} \
- strncpy(buffer, "nan", 4); \
+ strcpy(buffer, "nan"); \
} \
else { \
if (signbit(val)) { \
if (buf_size < 5) { \
return NULL; \
} \
- strncpy(buffer, "-inf", 5); \
+ strcpy(buffer, "-inf"); \
} \
else { \
if (buf_size < 4) { \
return NULL; \
} \
- strncpy(buffer, "inf", 4); \
+ strcpy(buffer, "inf"); \
} \
} \
return buffer; \