aboutsummaryrefslogtreecommitdiff
path: root/src/mime.c
diff options
context:
space:
mode:
authorDiego Nehab <diego@impa.br>2015-03-01 22:49:04 -0300
committerDiego Nehab <diego@impa.br>2015-03-01 22:49:04 -0300
commit8396a0291b2d97bc837c4c55bb99f7f6777ce515 (patch)
tree3e65b498ff30b00b32819037e4bfa2719286e9c7 /src/mime.c
parent9d49cdcf05d49a99d9095d63318f11adc73c10d0 (diff)
downloadluasocket-8396a0291b2d97bc837c4c55bb99f7f6777ce515.tar.gz
luasocket-8396a0291b2d97bc837c4c55bb99f7f6777ce515.tar.bz2
luasocket-8396a0291b2d97bc837c4c55bb99f7f6777ce515.zip
Better solution to luaL_checkint...
Diffstat (limited to 'src/mime.c')
-rw-r--r--src/mime.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/mime.c b/src/mime.c
index fdd1477..8edb750 100644
--- a/src/mime.c
+++ b/src/mime.c
@@ -13,11 +13,6 @@
13 13
14#include "mime.h" 14#include "mime.h"
15 15
16#if LUA_VERSION_NUM > 502 && !defined(LUA_COMPAT_APIINTCASTS)
17#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
18#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
19#endif
20
21/*=========================================================================*\ 16/*=========================================================================*\
22* Don't want to trust escape character constants 17* Don't want to trust escape character constants
23\*=========================================================================*/ 18\*=========================================================================*/
@@ -666,7 +661,7 @@ static int eolprocess(int c, int last, const char *marker,
666\*-------------------------------------------------------------------------*/ 661\*-------------------------------------------------------------------------*/
667static int mime_global_eol(lua_State *L) 662static int mime_global_eol(lua_State *L)
668{ 663{
669 int ctx = luaL_checkint(L, 1); 664 int ctx = luaL_checkinteger(L, 1);
670 size_t isize = 0; 665 size_t isize = 0;
671 const char *input = luaL_optlstring(L, 2, NULL, &isize); 666 const char *input = luaL_optlstring(L, 2, NULL, &isize);
672 const char *last = input + isize; 667 const char *last = input + isize;