scpi: Use locale independent sr_vsnprintf_ascii() and sr_vsprintf_ascii() functions.

This commit is contained in:
Frank Stettner 2018-02-11 16:01:51 +01:00 committed by Uwe Hermann
parent 7ca40d2d1c
commit 1c8901f744
1 changed files with 2 additions and 2 deletions

View File

@ -150,12 +150,12 @@ static int scpi_send_variadic(struct sr_scpi_dev_inst *scpi,
/* Get length of buffer required. */ /* Get length of buffer required. */
va_copy(args_copy, args); va_copy(args_copy, args);
len = vsnprintf(NULL, 0, format, args_copy); len = sr_vsnprintf_ascii(NULL, 0, format, args_copy);
va_end(args_copy); va_end(args_copy);
/* Allocate buffer and write out command. */ /* Allocate buffer and write out command. */
buf = g_malloc0(len + 2); buf = g_malloc0(len + 2);
vsprintf(buf, format, args); sr_vsprintf_ascii(buf, format, args);
if (buf[len - 1] != '\n') if (buf[len - 1] != '\n')
buf[len] = '\n'; buf[len] = '\n';