Skip to content

Commit 376690c

Browse files
author
vsky
committed
bme280_math Lua 5.3 compatibility issue with lua_pushfstring
1 parent 4baaaf6 commit 376690c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/modules/bme280_math.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,16 @@ int bme280_lua_setup(lua_State* L) {
246246
#undef r16sLE_buf
247247

248248
int i = 1;
249+
char cfg[2]={'\0', '\0'};
249250
lua_newtable(L); /* configuration table */
250-
lua_pushfstring(L, "%c", config);
251+
cfg[0]=(char)config;
252+
lua_pushstring(L, cfg);
251253
lua_rawseti(L, -2, i++);
252-
lua_pushfstring(L, "%c", bme280_ossh);
254+
cfg[0]=(char)bme280_ossh;
255+
lua_pushstring(L, cfg);
253256
lua_rawseti(L, -2, i++);
254-
lua_pushfstring(L, "%c", bme280_mode);
257+
cfg[0]=(char)bme280_mode;
258+
lua_pushstring(L, cfg);
255259
lua_rawseti(L, -2, i);
256260
return 2;
257261
}

0 commit comments

Comments
 (0)