summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/CmdLine/src/mimcmd_ipc.cpp2
-rw-r--r--plugins/MimCmd/MimCmd.vcxproj1
-rw-r--r--plugins/MimCmd/src/MimCmd.cpp35
3 files changed, 18 insertions, 20 deletions
diff --git a/plugins/CmdLine/src/mimcmd_ipc.cpp b/plugins/CmdLine/src/mimcmd_ipc.cpp
index 7ebbfc6cbf..f61b70eb82 100644
--- a/plugins/CmdLine/src/mimcmd_ipc.cpp
+++ b/plugins/CmdLine/src/mimcmd_ipc.cpp
@@ -65,7 +65,7 @@ int CreateSystemEvents()
heServerClose = CreateEventA(NULL, FALSE, FALSE, EVENT_SERVER_CLOSE);
heServerBufferFull = CreateEventA(NULL, FALSE, FALSE, EVENT_SERVER_BUFFERFULL);
- return ((heServerExec == NULL) || (heServerDone == NULL) || (heServerClose == NULL) || (heServerBufferFull == NULL));
+ return (heServerExec == NULL) || (heServerDone == NULL) || (heServerClose == NULL) || (heServerBufferFull == NULL);
}
int CreateMutexes()
diff --git a/plugins/MimCmd/MimCmd.vcxproj b/plugins/MimCmd/MimCmd.vcxproj
index 12b12d4efd..99f07ab2f4 100644
--- a/plugins/MimCmd/MimCmd.vcxproj
+++ b/plugins/MimCmd/MimCmd.vcxproj
@@ -31,6 +31,7 @@
<ItemDefinitionGroup>
<Link>
<SubSystem>Console</SubSystem>
+ <DelayLoadDLLs>mir_core.dll</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
</Project> \ No newline at end of file
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;
}