From d9701c84a7eab2d27d2e8807390360cc3739fe9d Mon Sep 17 00:00:00 2001 From: Hanspeter Portner Date: Fri, 3 Nov 2023 10:58:32 +0100 Subject: [PATCH] Fix strerror_l invocation to be XSI-compliant --- meson_options.txt | 2 +- src/eteroj_io.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 4777e68..3a4c2a4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -9,4 +9,4 @@ option('lv2libdir', type : 'string', value : 'lib/lv2') -option('version', type : 'string', value : '0.11.61') +option('version', type : 'string', value : '0.11.63') diff --git a/src/eteroj_io.c b/src/eteroj_io.c index da628c5..aff902c 100644 --- a/src/eteroj_io.c +++ b/src/eteroj_io.c @@ -550,16 +550,15 @@ run(LV2_Handle instance, uint32_t nsamples) static inline void _handle_enum(plughandle_t *handle, LV2_OSC_Enum ev) { - const char *err = ""; + char err [STR_LEN] = { '\0' }; if(ev & LV2_OSC_ERR) { - char buf [STR_LEN] = { '\0' }; - err = strerror_r(ev & LV2_OSC_ERR, buf, sizeof(buf)); + strerror_r(ev & LV2_OSC_ERR, err, sizeof(err)); - if(!err) + if(strlen(err) == 0) { - err = "Unknown"; + snprintf(err, sizeof(err), "%s", "Unknown"); } if(handle->log) -- 2.38.5