From 1984487b7d2737b121f44b8bbbbf1c49611321fa Mon Sep 17 00:00:00 2001 From: idk Date: Mon, 19 Sep 2022 02:35:17 -0400 Subject: [PATCH] fix space-finding function --- java/net/i2p/router/WindowsServiceUtil.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/java/net/i2p/router/WindowsServiceUtil.java b/java/net/i2p/router/WindowsServiceUtil.java index a600942..515d635 100644 --- a/java/net/i2p/router/WindowsServiceUtil.java +++ b/java/net/i2p/router/WindowsServiceUtil.java @@ -57,12 +57,11 @@ public class WindowsServiceUtil { // get the first occurrence of "STATE", then find the // next occurrence of of ":" after that. Count the // spaces between. - // numberOfSpaces = indexOf(":") - (indexOf(STATE)+5) + int indexOfState = qResult.indexOf("STATE"); if (indexOfState >= 0) { int indexOfColon = qResult.indexOf(":", indexOfState); statePrefix = "STATE"; - for (int f = 0; f == indexOfColon-5; f++) { + for (int f = indexOfState+5; f < indexOfColon; f++) { statePrefix += " "; } statePrefix += ": ";