1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

io: bugfix in state machine

This commit is contained in:
Manuel Pitz 2020-10-21 20:58:16 +02:00
parent 66e3f6f45d
commit 9e97e22d10

View file

@ -505,14 +505,14 @@ FILE * io_stream_input(struct io *io) {
int io_sscan(struct io *io, const char *buf, size_t len, size_t *rbytes, struct sample *smps[], unsigned cnt)
{
assert(io->state == State::CHECKED || io->state == State::OPENED);
assert(io->state == State::CHECKED || io->state == State::INITIALIZED || io->state == State::OPENED);
return io_type(io)->sscan ? io_type(io)->sscan(io, buf, len, rbytes, smps, cnt) : -1;
}
int io_sprint(struct io *io, char *buf, size_t len, size_t *wbytes, struct sample *smps[], unsigned cnt)
{
assert(io->state == State::CHECKED || io->state == State::OPENED);
assert(io->state == State::CHECKED || io->state == State::INITIALIZED || io->state == State::OPENED);
return io_type(io)->sprint ? io_type(io)->sprint(io, buf, len, wbytes, smps, cnt) : -1;
}