From patchwork Tue Sep 24 08:34:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 8151 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4XCY7q2Nvxz3wxp for ; Tue, 24 Sep 2024 08:34:47 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4XCY7n55Sgz369; Tue, 24 Sep 2024 08:34:45 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4XCY7n31kZz34LX; Tue, 24 Sep 2024 08:34:45 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4XCY7l705Yz33jw for ; Tue, 24 Sep 2024 08:34:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4XCY7l2wcJz1Tn; Tue, 24 Sep 2024 08:34:43 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1727166883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vLtR5abGIxBdPuEns7yX/ID1uLmShc9Z/SIBsUV3GX8=; b=Sn3Cy3Hae1pYDsaO9+NvqIcp8KvZlQ6p7mr5ZTB5dcpwO3vc7zjcE56kJXnNGEwDVtqTXv Qt1DnHOE9uKofqCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1727166883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vLtR5abGIxBdPuEns7yX/ID1uLmShc9Z/SIBsUV3GX8=; b=vNhAfZbLD4y2YPtlS4WHX0hSV7DVduRZUzNbXTaqZV89nXaUQ3Kz8ZW0FcybxSF4+hpRp0 lyqeW7LkryaXMExvAw9582kndGoflYaj86GsiwvtuNG8z/+ZHvkcVrlflLin97ItlcPhMJ oMHoTxoUOWt71+YjWd7tNbijn4x34lNQntqr57JJ2ib8zgvsZBvxg2ICob4T8HCr+T54Yu 20c3SX6gq2LGhOo1D5RbeqJNRBfuLoKRrLdb+QPvtYZTsSMFq0x/s/YvY0MvjuTg3ITHUT uZesyB1+6R7o5gjT5Y5n+zmLWgXYDG/ano5UPOpgRvvDjbWJltEdc5cnlAukMQ== 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 Message-ID-Hash: IHFVL52DQAEEDKASDNW3SYZVGR4I7AQX X-Message-ID-Hash: IHFVL52DQAEEDKASDNW3SYZVGR4I7AQX X-MailFrom: jonatan.schlag@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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) != NULL) { temp_line[strlen(temp_line) -1] = 0; - if ( strncmp(temp_line, _driver, strlen(_driver)) == 0 ) sprintf(nics[count].driver, "%s", temp_line+strlen(_driver)); - if ( strncmp(temp_line, _desc, strlen(_desc)) == 0 ) sprintf(nics[count].description, "%s", temp_line+strlen(_desc)); - if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) == 0 ) sprintf(nics[count].macaddr, "%s", temp_line+strlen(_network_hwaddr)); + if ( strncmp(temp_line, _driver, strlen(_driver)) == 0 ) { + sprintf(nics[count].driver, "%s", temp_line+strlen(_driver)); + } + if ( strncmp(temp_line, _desc, strlen(_desc)) == 0 ) { + sprintf(nics[count].description, "%s", temp_line+strlen(_desc)); + } + if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) == 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++;