summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-08-10 22:27:52 +0100
committerDamien George <damien.p.george@gmail.com>2014-08-10 22:27:52 +0100
commit6e6bcccdc19f35ccb09c064cb444eb498c307a33 (patch)
tree80d5d3e4267ad95f52a5a364eaaf3340e5e764b9 /unix
parent101d87da6ac24439cc0238775aba062edb7d649c (diff)
parent0c5498540b2005e39422647d2ca9cad1a4ff731b (diff)
downloadmicropython-6e6bcccdc19f35ccb09c064cb444eb498c307a33.tar.gz
micropython-6e6bcccdc19f35ccb09c064cb444eb498c307a33.zip
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'unix')
-rw-r--r--unix/modsocket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/unix/modsocket.c b/unix/modsocket.c
index d5b8e11c24..7eae1d8bf9 100644
--- a/unix/modsocket.c
+++ b/unix/modsocket.c
@@ -45,6 +45,7 @@
#include "obj.h"
#include "objtuple.h"
#include "objarray.h"
+#include "objstr.h"
#include "runtime.h"
#include "stream.h"
#include "builtin.h"
@@ -179,11 +180,11 @@ STATIC mp_obj_t socket_recv(uint n_args, const mp_obj_t *args) {
flags = MP_OBJ_SMALL_INT_VALUE(args[2]);
}
- char *buf = m_new(char, sz);
+ byte *buf = m_new(byte, sz);
int out_sz = recv(self->fd, buf, sz, flags);
RAISE_ERRNO(out_sz, errno);
- mp_obj_t ret = MP_OBJ_NEW_QSTR(qstr_from_strn(buf, out_sz));
+ mp_obj_t ret = mp_obj_new_str_of_type(&mp_type_bytes, buf, out_sz);
m_del(char, buf, sz);
return ret;
}