We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ef26c1 commit 2831a8fCopy full SHA for 2831a8f
1 file changed
unix/modsocket.c
@@ -45,6 +45,7 @@
45
#include "obj.h"
46
#include "objtuple.h"
47
#include "objarray.h"
48
+#include "objstr.h"
49
#include "runtime.h"
50
#include "stream.h"
51
#include "builtin.h"
@@ -179,11 +180,11 @@ STATIC mp_obj_t socket_recv(uint n_args, const mp_obj_t *args) {
179
180
flags = MP_OBJ_SMALL_INT_VALUE(args[2]);
181
}
182
- char *buf = m_new(char, sz);
183
+ byte *buf = m_new(byte, sz);
184
int out_sz = recv(self->fd, buf, sz, flags);
185
RAISE_ERRNO(out_sz, errno);
186
- mp_obj_t ret = MP_OBJ_NEW_QSTR(qstr_from_strn(buf, out_sz));
187
+ mp_obj_t ret = mp_obj_new_str_of_type(&mp_type_bytes, buf, out_sz);
188
m_del(char, buf, sz);
189
return ret;
190
0 commit comments