/*
* 2ooM: The Master of Orion II Reverse Engineering Project
* Library for working with LBX archive files.
- * Copyright © 2006-2010, 2013 Nick Bowler
+ * Copyright © 2006-2010, 2013-2014 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
static char str[256]; /* FIXME */
if (fileno >= lbx->pub.nfiles) {
- lbx_error_raise(LBX_ENOENT);
+ lbx_error_raise(LBX_EINVAL);
buf->name = NULL;
return -1;
}
struct lbx_file_state *state;
if (fileno >= lbx->pub.nfiles) {
- lbx_error_raise(LBX_ENOENT);
+ lbx_error_raise(LBX_EINVAL);
return NULL;
}
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)