mirror of
https://github.com/lua/lua.git
synced 2025-01-14 05:43:00 +08:00
no more default size for option 'c' in pack/unpack
This commit is contained in:
parent
6df197ec15
commit
32a1f54b9a
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lstrlib.c,v 1.216 2014/11/08 18:12:53 roberto Exp roberto $
|
** $Id: lstrlib.c,v 1.217 2014/11/11 19:40:20 roberto Exp roberto $
|
||||||
** Standard library for string operations and pattern-matching
|
** Standard library for string operations and pattern-matching
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -1084,7 +1084,11 @@ static KOption getoption (Header *h, const char **fmt, int *size) {
|
|||||||
case 'i': *size = getnumlimit(h, fmt, sizeof(int)); return Kint;
|
case 'i': *size = getnumlimit(h, fmt, sizeof(int)); return Kint;
|
||||||
case 'I': *size = getnumlimit(h, fmt, sizeof(int)); return Kuint;
|
case 'I': *size = getnumlimit(h, fmt, sizeof(int)); return Kuint;
|
||||||
case 's': *size = getnumlimit(h, fmt, sizeof(size_t)); return Kstring;
|
case 's': *size = getnumlimit(h, fmt, sizeof(size_t)); return Kstring;
|
||||||
case 'c': *size = getnum(fmt, 1); return Kchar;
|
case 'c':
|
||||||
|
*size = getnum(fmt, -1);
|
||||||
|
if (*size == -1)
|
||||||
|
luaL_error(h->L, "missing size for format option 'c'");
|
||||||
|
return Kchar;
|
||||||
case 'z': return Kzstr;
|
case 'z': return Kzstr;
|
||||||
case 'x': *size = 1; return Kpadding;
|
case 'x': *size = 1; return Kpadding;
|
||||||
case 'X': return Kpaddalign;
|
case 'X': return Kpaddalign;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user