summaryrefslogtreecommitdiff
path: root/remoteExample
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2021-01-21 12:25:06 +0100
committerArne Schwabe <arne@rfc2549.org>2021-02-16 16:40:04 +0100
commitccd5b7e72cc35fd95d21a63dfcdb22ce9a738992 (patch)
tree8e2de1d0eed78eb9945f877c7ac5f74195d23043 /remoteExample
parent96db8d0bf1110f029cf5ad90bc939cd444100600 (diff)
Make Coverity happy
Most of these things are minor to the point that changing them is only to make the scanner happy.
Diffstat (limited to 'remoteExample')
-rw-r--r--remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java b/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java
index 6eb85e9b..c450bf22 100644
--- a/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java
+++ b/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java
@@ -78,22 +78,22 @@ public class MainFragment extends Fragment implements View.OnClickListener, Hand
{
try {
InputStream conf = getActivity().getAssets().open("test.conf");
- InputStreamReader isr = new InputStreamReader(conf);
- BufferedReader br = new BufferedReader(isr);
- String config="";
+ BufferedReader br = new BufferedReader(new InputStreamReader(conf));
+ StringBuilder config= new StringBuilder();
String line;
while(true) {
line = br.readLine();
if(line == null)
break;
- config += line + "\n";
+ config.append(line).append("\n");
}
- br.readLine();
+ br.close();
+ conf.close();
if (addNew)
- mService.addNewVPNProfile("nonEditable", false, config);
+ mService.addNewVPNProfile("nonEditable", false, config.toString());
else
- mService.startVPN(config);
+ mService.startVPN(config.toString());
} catch (IOException | RemoteException e) {
e.printStackTrace();
}