From b71c11249d48143becd71237c9e9bfd3ce242b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Tue, 28 Mar 2023 10:28:15 +0200 Subject: [PATCH] Code cleanup --- Password Manager/PasswordGenerator.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Password Manager/PasswordGenerator.cs b/Password Manager/PasswordGenerator.cs index 634e2cc..aff5b8d 100644 --- a/Password Manager/PasswordGenerator.cs +++ b/Password Manager/PasswordGenerator.cs @@ -46,14 +46,13 @@ namespace Password_Generator CreateNoWindow = true } }; - proc.Start(); - StringBuilder builder = new StringBuilder(); + StringBuilder builder = new StringBuilder(); while (!proc.StandardOutput.EndOfStream) { - builder.Append(proc.StandardOutput.ReadLine()); - return builder.ToString(); + builder.Append(proc.StandardOutput.ReadLine()); + return builder.ToString(); } } catch (Exception ex) @@ -61,7 +60,6 @@ namespace Password_Generator MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } - } } }