diff options
author | Damien George <damien.p.george@gmail.com> | 2014-05-25 22:27:57 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-05-25 22:27:57 +0100 |
commit | 2617eebf2ff77e58f415162300747eaf1a5ab5d7 (patch) | |
tree | 7065586f59aa181b70b4721363ff7c7677f8e772 /unix/modsocket.c | |
parent | f88fc7bd23c7bab257a01857c6f4683ce491f78c (diff) |
Change const byte* to const char* where sensible.
This removes need for some casts (at least, more than it adds need
for new casts!).
Diffstat (limited to 'unix/modsocket.c')
-rw-r--r-- | unix/modsocket.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/unix/modsocket.c b/unix/modsocket.c index c4e80d3d5..16039bd81 100644 --- a/unix/modsocket.c +++ b/unix/modsocket.c @@ -167,8 +167,9 @@ STATIC mp_obj_t socket_recv(uint n_args, const mp_obj_t *args) { int out_sz = recv(self->fd, buf, sz, flags); RAISE_ERRNO(out_sz, errno); - buf = m_realloc(buf, sz, out_sz); - return MP_OBJ_NEW_QSTR(qstr_from_strn_take(buf, out_sz, out_sz)); + mp_obj_t ret = MP_OBJ_NEW_QSTR(qstr_from_strn(buf, out_sz)); + m_del(char, buf, sz); + return ret; } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_recv_obj, 2, 3, socket_recv); |