luaclient: formatting code using astyle

Origin commit data
------------------
Branch: ni/coolstream
Commit: 0a130f3a6d
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-01-31 (Tue, 31 Jan 2023)

Origin message was:
------------------
- luaclient: formatting code using astyle

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2023-01-31 23:34:11 +01:00
parent 2d9dc6aef0
commit 6387de8316
2 changed files with 23 additions and 16 deletions

View File

@@ -48,7 +48,8 @@ int main(int argc, char** argv)
if (!strcmp(cmd, "luaclient"))
argv++, argc--;
if (!*argv) {
if (!*argv)
{
fprintf(stderr,
"Usage: luaclient [command [arguments ...]]\n"
" or: command [arguments ...] (with command being a link to luaclient)\n");
@@ -57,7 +58,8 @@ int main(int argc, char** argv)
size_t len[argc];
size_t size = 0;
for (int i = 0; i < argc; i++) {
for (int i = 0; i < argc; i++)
{
len[i] = strlen(argv[i]) + 1;
size += len[i];
}
@@ -67,7 +69,8 @@ int main(int argc, char** argv)
memcpy(b, &size, sizeof(size));
size += sizeof(size);
b += sizeof(size);
for (int i = 0; i < argc; i++) {
for (int i = 0; i < argc; i++)
{
memcpy(b, argv[i], len[i]);
b += len[i];
}
@@ -78,23 +81,27 @@ int main(int argc, char** argv)
char *resp = NULL;
char *result = NULL;
if (!client.Send(data, size)) {
if (!client.Send(data, size))
{
fun = "Send failed";
goto fail;
}
if (!client.Recv((char *)&size, sizeof(size))) {
if (!client.Recv((char *)&size, sizeof(size)))
{
fun = "Recv (1) failed";
goto fail;
}
if (size)
result = (char *) malloc(size);
if (result && !client.Recv(result, size)) {
if (result && !client.Recv(result, size))
{
fun = "Recv (2) failed";
goto fail;
}
if (result[size - 1]) {
if (result[size - 1])
{
fun = "unterminated result";
goto fail;
}