]> sigrok.org Git - libsigrok.git/commit - hardware/sysclk-lwla/api.c
sysclk-lwla: Fix probe name issue.
authorUwe Hermann <redacted>
Tue, 14 Jan 2014 18:52:26 +0000 (19:52 +0100)
committerUwe Hermann <redacted>
Tue, 14 Jan 2014 18:52:26 +0000 (19:52 +0100)
commit1f98295dfa0e303e05b0472cb025c03d3b0cb42b
tree57793ae56626539fe558ba1500803066b1552c4d
parent2379783d85a90bc2930f7eaff348c91b2d60d015
sysclk-lwla: Fix probe name issue.

The g_ascii_formatd() function expects the "format" argument to start
with a '%' character, e.g. it should be "%f" or such (this is not
clearly documented in the glib API docs, but visible from the source code).

The usage of "CH%f" for example will trigger an assertion and thus make the
LWLA device unusable in practice (e.g. in PulseView on Windows no probenames
would be shown, and sampling wouldn't work).

Example:
  GLib-CRITICAL **: g_ascii_formatd: assertion 'format[0] == '%'' failed

(not exposed in all glib versions or builds of glib on all distros
apparently, some may need G_MESSAGES_DEBUG=all or other measures)

From the glib g_ascii_formatd() code:
  g_return_val_if_fail (format[0] == '%', NULL);

We now use g_snprintf() instead for simplicity. This has been tested to
fix this specific issue (i.e. the probenames now do show up in PulseView).

This closes bug #270.
hardware/sysclk-lwla/api.c