We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e3471c commit 7707196Copy full SHA for 7707196
mlx/io/load.cpp
@@ -265,15 +265,15 @@ array load(std::shared_ptr<io::Reader> in_stream, StreamOrDevice s) {
265
std::vector<char> buffer(header_len + 1);
266
in_stream->read(&buffer[0], header_len);
267
buffer[header_len] = 0;
268
- std::string header(&buffer[0]);
+ std::string header(buffer.data(), header_len);
269
270
// Read data type from header
271
std::string dtype_str = header.substr(11, 3);
272
bool read_is_big_endian = dtype_str[0] == '>';
273
Dtype dtype = dtype_from_array_protocol(dtype_str);
274
275
// Read contiguity order
276
- bool col_contiguous = header[34] == 'T';
+ bool col_contiguous = header.at(34) == 'T';
277
278
// Read array shape from header
279
Shape shape;
0 commit comments