summaryrefslogtreecommitdiff
path: root/plugins/MimCmd/src/MimCmd.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-15 17:46:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-15 17:46:17 +0000
commit4b48deb0396fd25e6146d2bd5deec6e792722e4c (patch)
tree0d1fb911f9723a046c2525dfd6c31a193d2485a0 /plugins/MimCmd/src/MimCmd.cpp
parent784d212b194e228563936068e69bc1f0e553cee2 (diff)
MimCmd to set path to libs too
git-svn-id: http://svn.miranda-ng.org/main/trunk@14181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MimCmd/src/MimCmd.cpp')
-rw-r--r--plugins/MimCmd/src/MimCmd.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/plugins/MimCmd/src/MimCmd.cpp b/plugins/MimCmd/src/MimCmd.cpp
index 6bad9d81aa..38a6ce511a 100644
--- a/plugins/MimCmd/src/MimCmd.cpp
+++ b/plugins/MimCmd/src/MimCmd.cpp
@@ -27,13 +27,11 @@ int lpprintf(const char *format, ...)
va_list va;
va_start(va, format);
const int MAX_SIZE = 16192;
- char buffer[MAX_SIZE] = {0};
- int len = mir_vsnprintf(buffer, MAX_SIZE - 1, format, va);
- buffer[MAX_SIZE - 1] = 0;
+ char buffer[MAX_SIZE] = { 0 };
+ int len = mir_vsnprintf(buffer, MAX_SIZE, format, va);
va_end(va);
CharToOemBuffA(buffer, buffer, len);
printf("%s", buffer);
-
return len;
}
@@ -74,33 +72,25 @@ 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()))
- {
+ if ((InitClient()) || (ConnectToMiranda()) || (GetKnownCommands()) || (LoadLangPackModule())) {
lpprintf("Could not create connection with Miranda or could not retrieve list of known commands.\n");
error = MIMRES_NOMIRANDA;
}
- else{
- if ((argc <= 1) || (argc > MAX_ARGUMENTS))
- {
+ else {
+ if (argc <= 1 || argc > MAX_ARGUMENTS)
PrintUsage();
- }
- else{
+ else {
PReply reply = ParseCommand(argv, argc);
- if (reply)
- {
+ if (reply) {
error = reply->code;
lpprintf("%s\n", reply->message);
}
- else{
- lpprintf(Translate("Unknown command '%s'.\n"), argv[1]);
- }
+ else lpprintf(Translate("Unknown command '%s'.\n"), argv[1]);
DestroyKnownCommands();
DisconnectFromMiranda();