aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-12-04 14:25:40 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-12-04 14:25:40 -0200
commit32a1f54b9aba958429dd3fd249b62199071ed8aa (patch)
tree0893fcf6f214ad730eb78023ab1127424ba3c944 /lstrlib.c
parent6df197ec150a33907dec61b5ca506744543aaea3 (diff)
downloadlua-32a1f54b9aba958429dd3fd249b62199071ed8aa.tar.gz
lua-32a1f54b9aba958429dd3fd249b62199071ed8aa.tar.bz2
lua-32a1f54b9aba958429dd3fd249b62199071ed8aa.zip
no more default size for option 'c' in pack/unpack
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 449fbef9..9fd906ae 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.216 2014/11/08 18:12:53 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.217 2014/11/11 19:40:20 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -1084,7 +1084,11 @@ static KOption getoption (Header *h, const char **fmt, int *size) {
1084 case 'i': *size = getnumlimit(h, fmt, sizeof(int)); return Kint; 1084 case 'i': *size = getnumlimit(h, fmt, sizeof(int)); return Kint;
1085 case 'I': *size = getnumlimit(h, fmt, sizeof(int)); return Kuint; 1085 case 'I': *size = getnumlimit(h, fmt, sizeof(int)); return Kuint;
1086 case 's': *size = getnumlimit(h, fmt, sizeof(size_t)); return Kstring; 1086 case 's': *size = getnumlimit(h, fmt, sizeof(size_t)); return Kstring;
1087 case 'c': *size = getnum(fmt, 1); return Kchar; 1087 case 'c':
1088 *size = getnum(fmt, -1);
1089 if (*size == -1)
1090 luaL_error(h->L, "missing size for format option 'c'");
1091 return Kchar;
1088 case 'z': return Kzstr; 1092 case 'z': return Kzstr;
1089 case 'x': *size = 1; return Kpadding; 1093 case 'x': *size = 1; return Kpadding;
1090 case 'X': return Kpaddalign; 1094 case 'X': return Kpaddalign;