aboutsummaryrefslogtreecommitdiff
path: root/lundump.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-02-07 17:15:24 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-02-07 17:15:24 -0200
commite7a9c45a4847d3ce058ac0e6051308591e7caf00 (patch)
treea802304497cd206432adc56a4f5bd1ab979c22d2 /lundump.c
parentfd6c1f489862d8ecf7055ca18898fffd006711fa (diff)
downloadlua-e7a9c45a4847d3ce058ac0e6051308591e7caf00.tar.gz
lua-e7a9c45a4847d3ce058ac0e6051308591e7caf00.tar.bz2
lua-e7a9c45a4847d3ce058ac0e6051308591e7caf00.zip
trying to avoid assumption that sizeof(char)==1
Diffstat (limited to 'lundump.c')
-rw-r--r--lundump.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lundump.c b/lundump.c
index 184b768f..161ef1d4 100644
--- a/lundump.c
+++ b/lundump.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lundump.c,v 1.67 2010/10/13 21:04:52 lhf Exp $ 2** $Id: lundump.c,v 2.14 2010/10/25 14:33:38 roberto Exp roberto $
3** load precompiled Lua chunks 3** load precompiled Lua chunks
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -211,8 +211,8 @@ Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name)
211void luaU_header (char* h) 211void luaU_header (char* h)
212{ 212{
213 int x=1; 213 int x=1;
214 memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1); 214 memcpy(h,LUA_SIGNATURE,(sizeof(LUA_SIGNATURE)-1)*sizeof(char));
215 h+=sizeof(LUA_SIGNATURE)-1; 215 h+=(sizeof(LUA_SIGNATURE)-1)*sizeof(char);
216 *h++=(char)LUAC_VERSION; 216 *h++=(char)LUAC_VERSION;
217 *h++=(char)LUAC_FORMAT; 217 *h++=(char)LUAC_FORMAT;
218 *h++=(char)*(char*)&x; /* endianness */ 218 *h++=(char)*(char*)&x; /* endianness */