From 2100f6e66a4ad02d0c390a1d3df1c1cb421d3221 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Tue, 20 Jun 2017 20:03:33 +0200 Subject: [PATCH] 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 --- src/tools/gpiomon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.30.2