From 2ec44cef64979d8e19eb66206c26a7bcad4bef8a Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 22 Jan 2014 20:54:33 -0500 Subject: [PATCH] liblbx: Rename LBX_ENOENT to LBX_EINVAL. General invalid argument makes more sense to have. --- src/error.c | 6 +++--- src/error.h | 2 +- src/image.c | 2 +- src/lbx.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/error.c b/src/error.c index 3e47204..e46c28f 100644 --- a/src/error.c +++ b/src/error.c @@ -1,7 +1,7 @@ /* * 2ooM: The Master of Orion II Reverse Engineering Project * Utilities for out-of-band error propagation. - * Copyright © 2010, 2013 Nick Bowler + * Copyright © 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 @@ -105,8 +105,8 @@ static void getmsg(int error, const char **msg) case LBX_EFORMAT: *msg = _("Invalid file format"); break; - case LBX_ENOENT: - *msg = _("Specified item does not exist"); + case LBX_EINVAL: + *msg = _("Invalid argument"); break; case LBX_ENOMEM: *msg = _("Memory allocation failed"); diff --git a/src/error.h b/src/error.h index 577078a..1e78688 100644 --- a/src/error.h +++ b/src/error.h @@ -5,7 +5,7 @@ enum { LBX_EOK, LBX_EMAGIC, LBX_EFORMAT, - LBX_ENOENT, + LBX_EINVAL, LBX_ENOMEM, LBX_EEOF, LBX_EMAX, diff --git a/src/image.c b/src/image.c index e0ee129..b30f165 100644 --- a/src/image.c +++ b/src/image.c @@ -331,7 +331,7 @@ unsigned char **lbx_img_getframe(struct lbx_image *pub, int frame) unsigned char buf[4]; if (frame >= pub->frames || frame < 0) { - lbx_error_raise(LBX_ENOENT); + lbx_error_raise(LBX_EINVAL); return NULL; } diff --git a/src/lbx.c b/src/lbx.c index a2d3796..30cd156 100644 --- a/src/lbx.c +++ b/src/lbx.c @@ -1,7 +1,7 @@ /* * 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 @@ -191,7 +191,7 @@ int lbx_file_stat(struct lbx *pub, unsigned fileno, struct lbx_statbuf *buf) 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; } @@ -221,7 +221,7 @@ struct lbx_file_state *lbx_file_open(struct lbx *pub, unsigned fileno) struct lbx_file_state *state; if (fileno >= lbx->pub.nfiles) { - lbx_error_raise(LBX_ENOENT); + lbx_error_raise(LBX_EINVAL); return NULL; } -- 2.43.0