diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-16 17:51:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-16 17:51:37 +0000 |
commit | 3d3376688a7a7ff1fe7838d350b31412c42d5ccd (patch) | |
tree | c135b13a26d93a4fea71e1bfbc38233783b214d6 /plugins/MimCmd/src/MimCmd.cpp | |
parent | d4ac653c0b8d6f474efea04127267ad6a54ced6d (diff) |
fix for mimcmd vs2010 project
git-svn-id: http://svn.miranda-ng.org/main/trunk@14213 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MimCmd/src/MimCmd.cpp')
-rw-r--r-- | plugins/MimCmd/src/MimCmd.cpp | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/plugins/MimCmd/src/MimCmd.cpp b/plugins/MimCmd/src/MimCmd.cpp index 38a6ce511a..6836069241 100644 --- a/plugins/MimCmd/src/MimCmd.cpp +++ b/plugins/MimCmd/src/MimCmd.cpp @@ -28,7 +28,7 @@ int lpprintf(const char *format, ...) va_start(va, format);
const int MAX_SIZE = 16192;
char buffer[MAX_SIZE] = { 0 };
- int len = mir_vsnprintf(buffer, MAX_SIZE, format, va);
+ int len = _vsnprintf(buffer, MAX_SIZE, format, va);
va_end(va);
CharToOemBuffA(buffer, buffer, len);
printf("%s", buffer);
@@ -71,32 +71,29 @@ void ShowVersion() int main(int argc, char *argv[])
{
- int error = 0;
- if ((argc == 2) && (mir_strcmp(argv[1], "-v") == 0)) {
+ if (argc == 2 && mir_strcmp(argv[1], "-v") == 0) {
ShowVersion();
return 0;
}
if ((InitClient()) || (ConnectToMiranda()) || (GetKnownCommands()) || (LoadLangPackModule())) {
lpprintf("Could not create connection with Miranda or could not retrieve list of known commands.\n");
- error = MIMRES_NOMIRANDA;
+ return MIMRES_NOMIRANDA;
}
+
+ if (argc <= 1 || argc > MAX_ARGUMENTS)
+ PrintUsage();
else {
- if (argc <= 1 || argc > MAX_ARGUMENTS)
- PrintUsage();
- else {
- PReply reply = ParseCommand(argv, argc);
- if (reply) {
- error = reply->code;
- lpprintf("%s\n", reply->message);
- }
- else lpprintf(Translate("Unknown command '%s'.\n"), argv[1]);
-
- DestroyKnownCommands();
- DisconnectFromMiranda();
- DestroyClient();
+ PReply reply = ParseCommand(argv, argc);
+ if (reply) {
+ error = reply->code;
+ lpprintf("%s\n", reply->message);
}
- }
+ else lpprintf(Translate("Unknown command '%s'.\n"), argv[1]);
- return error;
+ DestroyKnownCommands();
+ DisconnectFromMiranda();
+ DestroyClient();
+ }
+ return 0;
}
|