Commit 46f11eda authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Print error messages to stderr as is customary.

parent 4715f132
...@@ -72,10 +72,10 @@ void error_unknown_switch(char chu, char *s) ...@@ -72,10 +72,10 @@ void error_unknown_switch(char chu, char *s)
{ {
if (isalpha(chu)) if (isalpha(chu))
{ {
printf("%s: Undefined switch /%c!\n", getAppName(), chu); fprintf(stderr,"%s: Undefined switch /%c!\n", getAppName(), chu);
} else { } else {
printf("%s: Alphabetic character is expected after '%c' " fprintf(stderr,"%s: Alphabetic character is expected after '%c' "
"in switch specification\n", getAppName(), *(s - 1)); "in swit ch specification\n", getAppName(), *(s - 1));
} }
exit(1); exit(1);
} }
...@@ -111,7 +111,7 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine) ...@@ -111,7 +111,7 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine)
action = ACTION_EXPORT; action = ACTION_EXPORT;
break; break;
case '?': case '?':
printf(usage); fprintf(stderr,usage);
exit(0); exit(0);
break; break;
default: default:
...@@ -174,8 +174,8 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s) ...@@ -174,8 +174,8 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
get_file_name(&s, filename); get_file_name(&s, filename);
if (!filename[0]) if (!filename[0])
{ {
printf("%s: No file name is specified\n", getAppName()); fprintf(stderr,"%s: No file name is specified\n", getAppName());
printf(usage); fprintf(stderr,usage);
exit(1); exit(1);
} }
...@@ -187,7 +187,7 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s) ...@@ -187,7 +187,7 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
processRegLines(reg_file, doSetValue); processRegLines(reg_file, doSetValue);
} else { } else {
perror(""); perror("");
printf("%s: Can't open file \"%s\"\n", getAppName(), filename); fprintf(stderr,"%s: Can't open file \"%s\"\n", getAppName(), filename);
exit(1); exit(1);
} }
get_file_name(&s, filename); get_file_name(&s, filename);
...@@ -201,9 +201,9 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s) ...@@ -201,9 +201,9 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
get_file_name(&s, reg_key_name); get_file_name(&s, reg_key_name);
if (!reg_key_name[0]) if (!reg_key_name[0])
{ {
printf("%s: No registry key is specified for removal\n", fprintf(stderr,"%s: No registry key is specified for removal\n",
getAppName()); getAppName());
printf(usage); fprintf(stderr,usage);
exit(1); exit(1);
} }
delete_registry_key(reg_key_name); delete_registry_key(reg_key_name);
...@@ -217,8 +217,8 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s) ...@@ -217,8 +217,8 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
get_file_name(&s, filename); get_file_name(&s, filename);
if (!filename[0]) if (!filename[0])
{ {
printf("%s: No file name is specified\n", getAppName()); fprintf(stderr,"%s: No file name is specified\n", getAppName());
printf(usage); fprintf(stderr,usage);
exit(1); exit(1);
} }
...@@ -234,7 +234,7 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s) ...@@ -234,7 +234,7 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
break; break;
} }
default: default:
printf("%s: Unhandled action!\n", getAppName()); fprintf(stderr,"%s: Unhandled action!\n", getAppName());
exit(1); exit(1);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment