From 47d568796d3b352bd1789caa29416b779df8c641 Mon Sep 17 00:00:00 2001 From: Jaroslaw Pelczar Date: Wed, 28 Aug 2019 09:44:01 +0200 Subject: [PATCH] KPPPInterface.cpp: Fix GCC error src/add-ons/kernel/network/ppp/shared/libkernelppp/KPPPInterface.cpp: In member function 'void KPPPInterface::CalculateBaudRate()': src/add-ons/kernel/network/ppp/shared/libkernelppp/KPPPInterface.cpp:2018:4: error: this 'if' clause does not guard... [-Werror=misleading-indentation] if (ChildAt(index)->Ifnet()) ^~ src/add-ons/kernel/network/ppp/shared/libkernelppp/KPPPInterface.cpp:2020:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' return; Signed-off-by: Jaroslaw Pelczar Change-Id: I8790a8ea3a961d73073b295ac438f3c60c16fcba Reviewed-on: https://review.haiku-os.org/c/haiku/+/1759 Reviewed-by: waddlesplash --- .../network/ppp/shared/libkernelppp/KPPPInterface.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/network/ppp/shared/libkernelppp/KPPPInterface.cpp b/src/add-ons/kernel/network/ppp/shared/libkernelppp/KPPPInterface.cpp index b42207be60..cdb6e9809c 100644 --- a/src/add-ons/kernel/network/ppp/shared/libkernelppp/KPPPInterface.cpp +++ b/src/add-ons/kernel/network/ppp/shared/libkernelppp/KPPPInterface.cpp @@ -2013,10 +2013,12 @@ KPPPInterface::CalculateBaudRate() Device()->OutputTransferRate()); else { fIfnet->link_speed = 0; - for (int32 index = 0; index < CountChildren(); index++) - if (ChildAt(index)->Ifnet()) - fIfnet->link_speed += ChildAt(index)->Ifnet()->link_speed; + for (int32 index = 0; index < CountChildren(); index++) { + if (ChildAt(index)->Ifnet()) { + fIfnet->link_speed = ChildAt(index)->Ifnet()->link_speed; return; + } + } } }