From 0880428184a5a48711d5c38813ca8903c9adea7e Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Tue, 25 May 2021 12:21:55 +0100 Subject: [PATCH] avoid global vars --- src/TaskRouter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/TaskRouter.cpp b/src/TaskRouter.cpp index df54ec6..a975691 100644 --- a/src/TaskRouter.cpp +++ b/src/TaskRouter.cpp @@ -33,11 +33,10 @@ bool RouterTask::loop(System &system) { // do routing if (!_fromModem.empty()) { std::shared_ptr modemMsg = _fromModem.getElement(); - String path; if (system.getUserConfig()->aprs_is.active && modemMsg->getSource() != system.getUserConfig()->callsign) { std::shared_ptr aprsIsMsg = std::make_shared(*modemMsg); - path = aprsIsMsg->getPath(); + String path = aprsIsMsg->getPath(); if (!(path.indexOf("RFONLY") != -1 || path.indexOf("NOGATE") != -1 || path.indexOf("TCPIP") != -1)) { if (!path.isEmpty()) { @@ -62,7 +61,7 @@ bool RouterTask::loop(System &system) { if (system.getUserConfig()->digi.active && modemMsg->getSource() != system.getUserConfig()->callsign) { std::shared_ptr digiMsg = std::make_shared(*modemMsg); - path = digiMsg->getPath(); + String path = digiMsg->getPath(); // simple loop check if (path.indexOf("WIDE1-1") >= 0 || path.indexOf(system.getUserConfig()->callsign) == -1) {