|
|
@@ -168,7 +168,7 @@ static int Rocket_init(Rocket *self, PyObject *args, PyObject *kwds) |
|
|
|
if (!layout) |
|
|
|
return -1; |
|
|
|
if (path) { |
|
|
|
if (strlen(path) != pathlen) { |
|
|
|
if (strlen(path) != (size_t)pathlen) { |
|
|
|
PyErr_SetString(PyExc_ValueError, "path must not " |
|
|
|
"contain NUL characters"); |
|
|
|
return -1; |
|
|
@@ -477,7 +477,7 @@ static PyObject *Rocket_append_binary(Rocket *self, PyObject *args) |
|
|
|
} |
|
|
|
|
|
|
|
/* Write binary data */ |
|
|
|
if (fwrite(data, self->binary_size, rows, self->file) != rows) { |
|
|
|
if (fwrite(data, self->binary_size, rows, self->file) != (size_t)rows) { |
|
|
|
PyErr_SetFromErrno(PyExc_OSError); |
|
|
|
return NULL; |
|
|
|
} |
|
|
@@ -628,7 +628,7 @@ static PyObject *Rocket_extract_binary(Rocket *self, PyObject *args) |
|
|
|
|
|
|
|
/* Data in the file is already in the desired little-endian |
|
|
|
binary format, so just read it directly. */ |
|
|
|
if (fread(str, self->binary_size, count, self->file) != count) { |
|
|
|
if (fread(str, self->binary_size, count, self->file) != (size_t)count) { |
|
|
|
free(str); |
|
|
|
PyErr_SetFromErrno(PyExc_OSError); |
|
|
|
return NULL; |
|
|
|