diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-26 10:31:58 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-26 10:31:58 +0100 |
commit | d139c489bab6b58906868e3fc8383ea813a122d4 (patch) | |
tree | 4566ebb0dce5292128e418be74811e34ad8f984f /unix | |
parent | 6cebe24b7d57432c623625e8eb1a0cb100df369c (diff) | |
parent | e14d096cb7a30b956f6c5b610c6854a6b17d0592 (diff) | |
download | micropython-d139c489bab6b58906868e3fc8383ea813a122d4.tar.gz micropython-d139c489bab6b58906868e3fc8383ea813a122d4.zip |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'unix')
-rw-r--r-- | unix/modsocket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/unix/modsocket.c b/unix/modsocket.c index b7d167c8ad..4c76502da6 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -148,9 +148,9 @@ STATIC mp_obj_t socket_send(uint n_args, const mp_obj_t *args) { flags = MP_OBJ_SMALL_INT_VALUE(args[2]); } - uint sz; - const char *buf = mp_obj_str_get_data(args[1], &sz); - int out_sz = send(self->fd, buf, sz, flags); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_READ); + int out_sz = send(self->fd, bufinfo.buf, bufinfo.len, flags); RAISE_ERRNO(out_sz, errno); return MP_OBJ_NEW_SMALL_INT((machine_int_t)out_sz); |