[PATCH 3/7] reg: Exit with an error if the specified operation is invalid

Hugh McMaster hugh.mcmaster at outlook.com
Fri Jun 3 00:23:39 CDT 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/reg/reg.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/programs/reg/reg.c b/programs/reg/reg.c
index 3ba3902..db737f7 100644
--- a/programs/reg/reg.c
+++ b/programs/reg/reg.c
@@ -939,6 +939,13 @@ int wmain(int argc, WCHAR *argvW[])
 
     op = get_operation(argvW[1]);
 
+    if (op == REG_INVALID)
+    {
+        output_message(STRING_INVALID_OPTION, argvW[1]);
+        output_message(STRING_REG_HELP);
+        return 1;
+    }
+
     if (op == REG_ADD)
     {
         WCHAR *key_name, *value_name = NULL, *type = NULL, separator = '\0', *data = NULL;
-- 
1.9.1




More information about the wine-patches mailing list