diff options
Diffstat (limited to 'dmi.c')
-rw-r--r-- | dmi.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -107,13 +107,14 @@ static char *get_dmi_string(const char *string_name) } /* Kill lines starting with '#', as recent dmidecode versions - have the quirk to emit a "# SMBIOS implementations newer..." - message even on "-s" if the SMBIOS declares a - newer-than-supported version number, while it *should* only print - the requested string. */ + * have the quirk to emit a "# SMBIOS implementations newer..." + * message even on "-s" if the SMBIOS declares a + * newer-than-supported version number, while it *should* only print + * the requested string. + */ do { if (!fgets(answerbuf, DMI_MAX_ANSWER_LEN, dmidecode_pipe)) { - if(ferror(dmidecode_pipe)) { + if (ferror(dmidecode_pipe)) { msg_perr("DMI pipe read error\n"); pclose(dmidecode_pipe); return NULL; @@ -121,7 +122,7 @@ static char *get_dmi_string(const char *string_name) answerbuf[0] = 0; /* Hit EOF */ } } - } while(answerbuf[0] == '#'); + } while (answerbuf[0] == '#'); /* Toss all output above DMI_MAX_ANSWER_LEN away to prevent deadlock on pclose. */ @@ -129,13 +130,12 @@ static char *get_dmi_string(const char *string_name) getc(dmidecode_pipe); if (pclose(dmidecode_pipe) != 0) { msg_pinfo("dmidecode execution unsuccessful - continuing " - "without DMI info\n"); + "without DMI info\n"); return NULL; } /* Chomp trailing newline. */ - if (answerbuf[0] != 0 && - answerbuf[strlen(answerbuf) - 1] == '\n') + if (answerbuf[0] != 0 && answerbuf[strlen(answerbuf) - 1] == '\n') answerbuf[strlen(answerbuf) - 1] = 0; msg_pdbg("DMI string %s: \"%s\"\n", string_name, answerbuf); @@ -196,8 +196,7 @@ void dmi_init(void) */ static int dmi_compare(const char *value, const char *pattern) { - int anchored = 0; - int patternlen; + int anchored = 0, patternlen; msg_pspew("matching %s against %s\n", value, pattern); /* The empty string is part of all strings! */ |