From b5886f298e6f5d35565b75afc8e77f8e6f9e8b1d Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Wed, 4 Mar 2020 21:39:07 +0000 Subject: [PATCH] irqtop: trim white spaces from end of name field Excess white spaces were easiest to see in json output. $ irqtop --once --json { "interrupts": [ {"irq":"LOC", "total":7425148, "name":"Local timer interrupts "}, {"irq":"51", "total":1848384, "name":"IR-PCI-MSI 32768-edge i915 "}, {"irq":"RES", "total":1176665, "name":"Rescheduling interrupts "}, ... Signed-off-by: Sami Kerola --- sys-utils/irqtop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys-utils/irqtop.c b/sys-utils/irqtop.c index 3c12530058..15fa2ff852 100644 --- a/sys-utils/irqtop.c +++ b/sys-utils/irqtop.c @@ -324,6 +324,7 @@ static struct irq_stat *get_irqinfo(void) while (isspace(*tmp)) tmp++; tmp = remove_repeated_spaces(tmp); + rtrim_whitespace((unsigned char *)tmp); curr->name = xstrdup(tmp); } else /* no irq name string, we have to set '\0' here */ curr->name = xstrdup(""); -- 2.47.3