From: Sami Kerola Date: Wed, 4 Mar 2020 21:39:07 +0000 (+0000) Subject: irqtop: trim white spaces from end of name field X-Git-Tag: v2.36-rc1~196^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5886f298e6f5d35565b75afc8e77f8e6f9e8b1d;p=thirdparty%2Futil-linux.git 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 --- 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("");