From e7a9c45a4847d3ce058ac0e6051308591e7caf00 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 7 Feb 2011 17:15:24 -0200 Subject: trying to avoid assumption that sizeof(char)==1 --- lundump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lundump.c') diff --git a/lundump.c b/lundump.c index 184b768f..161ef1d4 100644 --- a/lundump.c +++ b/lundump.c @@ -1,5 +1,5 @@ /* -** $Id: lundump.c,v 1.67 2010/10/13 21:04:52 lhf Exp $ +** $Id: lundump.c,v 2.14 2010/10/25 14:33:38 roberto Exp roberto $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -211,8 +211,8 @@ Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) void luaU_header (char* h) { int x=1; - memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1); - h+=sizeof(LUA_SIGNATURE)-1; + memcpy(h,LUA_SIGNATURE,(sizeof(LUA_SIGNATURE)-1)*sizeof(char)); + h+=(sizeof(LUA_SIGNATURE)-1)*sizeof(char); *h++=(char)LUAC_VERSION; *h++=(char)LUAC_FORMAT; *h++=(char)*(char*)&x; /* endianness */ -- cgit v1.2.3-55-g6feb