X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/4e1f80572a3fa2687d9350a7c211507ed382c9fb..131cef630544d733d13bb493a05ff6ae523a0538:/src/lbx.c diff --git a/src/lbx.c b/src/lbx.c index 30cd156..1198ebb 100644 --- a/src/lbx.c +++ b/src/lbx.c @@ -282,10 +282,15 @@ int lbx_file_seek(struct lbx_file_state *f, long offset, int whence) case SEEK_END: pos = f->limit + offset; break; + default: + lbx_error_raise(LBX_EINVAL); + return -1; } - if (pos > f->limit) + if (pos > f->limit) { + lbx_error_raise(LBX_EINVAL); return -1; + } f->lbx->last_file = NULL; if (fops->seek(f->lbx->f, f->base + pos, SEEK_SET) != 0)