From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH 1/2] setup: Reformat the C Code Date: Tue, 24 Sep 2024 10:34:32 +0200 Message-ID: <20240924083433.48085-1-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3222995116749402263==" List-Id: --===============3222995116749402263== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Otherwise the line wraps at position where it does not make any sense. Signed-off-by: Jonatan Schlag --- src/setup/netstuff.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c index 60e27242f..ec4c31513 100644 --- a/src/setup/netstuff.c +++ b/src/setup/netstuff.c @@ -602,9 +602,15 @@ int scan_network_cards(void) while (fgets(temp_line, STRING_SIZE, fp) !=3D NULL) { temp_line[strlen(temp_line) -1] =3D 0; - if ( strncmp(temp_line, _driver, strlen(_driver)) =3D=3D = 0 ) sprintf(nics[count].driver, "%s", temp_line+strlen(_driver)); - if ( strncmp(temp_line, _desc, strlen(_desc)) =3D=3D = 0 ) sprintf(nics[count].description, "%s", temp_line+strlen(_desc)); - if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) =3D=3D = 0 ) sprintf(nics[count].macaddr, "%s", temp_line+strlen(_network_hwaddr)= ); + if ( strncmp(temp_line, _driver, strlen(_driver)) =3D=3D 0 ) { + sprintf(nics[count].driver, "%s", temp_line+strlen(_driver)); + } + if ( strncmp(temp_line, _desc, strlen(_desc)) =3D=3D 0 ) { + sprintf(nics[count].description, "%s", temp_line+strlen(_desc)); + } + if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) =3D=3D = 0 ) { + sprintf(nics[count].macaddr, "%s", temp_line+strlen(_network_hwaddr)= ); + } if (strlen(nics[count].macaddr) > 15 ) { sprintf(nics[count].nic, "%s", find_nic4mac(nics[count].macaddr)); count++; --=20 2.39.5 --===============3222995116749402263==--