diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-02-07 17:15:24 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-02-07 17:15:24 -0200 |
commit | e7a9c45a4847d3ce058ac0e6051308591e7caf00 (patch) | |
tree | a802304497cd206432adc56a4f5bd1ab979c22d2 /lundump.c | |
parent | fd6c1f489862d8ecf7055ca18898fffd006711fa (diff) | |
download | lua-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) | |||
211 | void luaU_header (char* h) | 211 | void 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 */ |