File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -303,8 +303,22 @@ SR_PRIV const char *scpi_dmm_owon_get_range_text(const struct sr_dev_inst *sdi)
303303 return NULL ;
304304 }
305305 /* Replace Unicode Omega symbol (0xCE 0xA9) with "Ohm". */
306+ #if __GLIBC_PREREQ (2 , 68 )
306307 GString * response_str = g_string_new (response );
307308 g_string_replace (response_str , "\xCE\xA9" , "Ohm" , 0 );
309+ #else
310+ GString * response_str = g_string_new ("" );
311+ const char * src = response ;
312+ while (* src ) {
313+ if (src [0 ] == '\xCE' && src [1 ] == '\xA9' ) {
314+ g_string_append (response_str , "Ohm" );
315+ src += 2 ;
316+ } else {
317+ g_string_append_c (response_str , * src );
318+ src ++ ;
319+ }
320+ }
321+ #endif
308322 g_free (response );
309323 response = g_string_free (response_str , FALSE);
310324
You can’t perform that action at this time.
0 commit comments