-/* NetHack 3.6 nhlua.c $NHDT-Date: 1574825214 2019/11/27 03:26:54 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.9 $ */
+/* NetHack 3.6 nhlua.c $NHDT-Date: 1575071986 2019/11/29 23:59:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.12 $ */
/* Copyright (c) 2018 by Pasi Kallinen */
/* NetHack may be freely redistributed. See license for details. */
char *buf = (char *) 0;
long buflen;
int cnt, llret;
- long bufidx = 0;
fh = dlb_fopen(fname, "r");
if (!fh) {
dlb_fseek(fh, 0L, SEEK_SET);
if ((cnt = dlb_fread(buf, 1, buflen, fh)) != buflen) {
- impossible("nhl_loadlua: Error loading %s, got %i/%li bytes", fname, cnt, buflen);
+ impossible("nhl_loadlua: Error loading %s, got %i/%li bytes",
+ fname, cnt, buflen);
ret = FALSE;
goto give_up;
}
llret = luaL_loadstring(L, buf);
if (llret != LUA_OK) {
- impossible("luaL_loadstring: Error loading %s (errcode %i)", fname, llret);
+ impossible("luaL_loadstring: Error loading %s (errcode %i)",
+ fname, llret);
ret = FALSE;
goto give_up;
} else {
}
}
-give_up:
+ give_up:
if (buf) {
free(buf);
buf = (char *) 0;
goto give_up;
}
-give_up:
+ give_up:
lua_close(L);
return ret;