diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-09 22:04:45 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-09 22:04:45 +0000 |
commit | 2d45429122e61c7292349986e6bc77f4b74d80a0 (patch) | |
tree | a5b4f9eff51fa6a42c2bccbff8c15d60de70d4d6 /py/objstr.c | |
parent | 0d4cab13dd5a26a4f635996a74c2dd914a7dc344 (diff) | |
download | micropython-2d45429122e61c7292349986e6bc77f4b74d80a0.tar.gz micropython-2d45429122e61c7292349986e6bc77f4b74d80a0.zip |
Use memcpy instead of strncpy; add usart.status to stm.
Diffstat (limited to 'py/objstr.c')
-rw-r--r-- | py/objstr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c index 58e8bcf6fd..ea4f5ead24 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -200,7 +200,7 @@ mp_obj_t str_strip(int n_args, const mp_obj_t *args) { size_t stripped_len = last_good_char_pos - first_good_char_pos + 1; //+1 to accomodate '\0' char *stripped_str = m_new(char, stripped_len + 1); - strncpy(stripped_str, orig_str + first_good_char_pos, stripped_len); + memcpy(stripped_str, orig_str + first_good_char_pos, stripped_len); stripped_str[stripped_len] = '\0'; return mp_obj_new_str(qstr_from_str_take(stripped_str, stripped_len + 1)); } |