From 3d734e2df3cbcfbef47f1327748116bef428f89f Mon Sep 17 00:00:00 2001 From: Packit Bot Date: May 04 2021 22:15:56 +0000 Subject: Apply patch 0018-dmidecode-Add-helper-function-for-separators.patch patch_name: 0018-dmidecode-Add-helper-function-for-separators.patch present_in_specfile: true --- diff --git a/dmidecode.c b/dmidecode.c index 5e9b989..3551637 100644 --- a/dmidecode.c +++ b/dmidecode.c @@ -5068,7 +5068,7 @@ static void dmi_decode(const struct dmi_header *h, u16 ver) h->type >= 128 ? "OEM-specific" : "Unknown"); dmi_dump(h); } - printf("\n"); + pr_sep(); } static void to_dmi_header(struct dmi_header *h, u8 *data) @@ -5195,7 +5195,8 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags) if ((unsigned long)(next - buf) > len) { if (display && !(opt.flags & FLAG_QUIET)) - printf("\t\n\n"); + printf("\t\n"); + pr_sep(); data = next; break; } @@ -5213,7 +5214,7 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags) if (opt.flags & FLAG_DUMP) { dmi_dump(&h); - printf("\n"); + pr_sep(); } else dmi_decode(&h, ver); @@ -5271,7 +5272,7 @@ static void dmi_table(off_t base, u32 len, u16 num, u32 ver, const char *devmem, pr_info("Table at 0x%08llX.", (unsigned long long)base); } - printf("\n"); + pr_sep(); } if ((flags & FLAG_NO_FILE_OFFSET) || (opt.flags & FLAG_FROM_DUMP)) diff --git a/dmioutput.c b/dmioutput.c index da04450..ef1c41b 100644 --- a/dmioutput.c +++ b/dmioutput.c @@ -118,3 +118,8 @@ void pr_list_end(void) { /* a no-op for text output */ } + +void pr_sep(void) +{ + printf("\n"); +} diff --git a/dmioutput.h b/dmioutput.h index 58ca5a8..6b5f0e0 100644 --- a/dmioutput.h +++ b/dmioutput.h @@ -30,3 +30,4 @@ void pr_subattr(const char *name, const char *format, ...); void pr_list_start(const char *name, const char *format, ...); void pr_list_item(const char *format, ...); void pr_list_end(void); +void pr_sep(void);