From: Bartosz Golaszewski Date: Tue, 20 Jun 2017 18:03:33 +0000 (+0200) Subject: gpiomon: fix parsing of custom output formats X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2100f6e66a4ad02d0c390a1d3df1c1cb421d3221;p=qemu-gpiodev%2Flibgpiod.git gpiomon: fix parsing of custom output formats The '%%e' string should be printed as '%e' - the same as for printf() format specifiers - but gpiomon prints '%%e' in this case. Fix it. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/tools/gpiomon.c b/src/tools/gpiomon.c index b54ee2b..10b07d9 100644 --- a/src/tools/gpiomon.c +++ b/src/tools/gpiomon.c @@ -123,7 +123,8 @@ static void event_print_custom(int type, const struct timespec *ts, off = pos - str; if (fmt == '%') { - off += 2; + memmove(str + off, str + off + 1, strlen(str) - off); + off += 1; continue; }