aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lstrlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lstrlib.c b/lstrlib.c
index a5b0b15f..d2d05a80 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.213 2014/11/04 14:34:43 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.214 2014/11/05 18:50:29 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*/
@@ -1146,7 +1146,7 @@ static void packint (luaL_Buffer *b, lua_Unsigned n,
1146 n >>= NB; 1146 n >>= NB;
1147 buff[islittle ? i : size - 1 - i] = (char)(n & MC); 1147 buff[islittle ? i : size - 1 - i] = (char)(n & MC);
1148 } 1148 }
1149 if (neg) { /* need sign extension (negative number)? */ 1149 if (neg && size > SZINT) { /* negative number need sign extension? */
1150 for (i = SZINT; i < size; i++) /* correct extra bytes */ 1150 for (i = SZINT; i < size; i++) /* correct extra bytes */
1151 buff[islittle ? i : size - 1 - i] = (char)MC; 1151 buff[islittle ? i : size - 1 - i] = (char)MC;
1152 } 1152 }