From d3833ede2947a267e38d2ec19c6ad713e94baed8 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Tue, 23 Dec 2025 11:15:11 +0100 Subject: [PATCH] weirder things are happening --- src/lua_rds.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lua_rds.c b/src/lua_rds.c index 8b4fe52..4aef48e 100644 --- a/src/lua_rds.c +++ b/src/lua_rds.c @@ -78,9 +78,9 @@ int lua_get_rds_##name(lua_State *localL) { \ lua_pushboolean(localL, mod->enc->data[mod->enc->program].name); \ return 1; \ } -#define STR_RAW_GETTER(name) \ +#define STR_RAW_GETTER(name, length) \ int lua_get_rds_##name(lua_State *localL) { \ - lua_pushstring(localL, mod->enc->data[mod->enc->program].name); \ + lua_pushlstring(localL, mod->enc->data[mod->enc->program].name, length); \ return 1; \ } INT_SETTER(pi) @@ -259,13 +259,13 @@ STR_SETTER(rt1, set_rds_rt1) STR_SETTER(rt2, set_rds_rt2) STR_RAW_SETTER(lps, set_rds_lps) -STR_RAW_GETTER(lps) +STR_RAW_GETTER(lps, LPS_LENGTH) STR_RAW_SETTER(ert, set_rds_ert) -STR_RAW_GETTER(ert) +STR_RAW_GETTER(ert, ERT_LENGTH) STR_RAW_SETTER(grp_sqc_rds2, set_rds_grpseq2) -STR_RAW_GETTER(grp_sqc_rds2) +STR_RAW_GETTER(grp_sqc_rds2, 24) int lua_set_rds_grp_sqc(lua_State *localL) { const char* str = luaL_checklstring(localL, 1, NULL); @@ -273,7 +273,7 @@ int lua_set_rds_grp_sqc(lua_State *localL) { else set_rds_grpseq(mod->enc, str); return 0; } -STR_RAW_GETTER(grp_sqc) +STR_RAW_GETTER(grp_sqc, 24) AF_SETTER(af_group0, af, RDSAFs, add_rds_af) AF_SETTER(af_oda, af_oda, RDSAFsODA, add_rds_af_oda)