Fixed missing semicolons
Fixed default struct initialization because I write C++ normally Fixed bug where uniproc_win64.c would not correctly append arguments to the command-line string
This commit is contained in:
@@ -4,12 +4,12 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FILE* in = NULL;
|
FILE* in;
|
||||||
FILE* out= NULL;
|
FILE* out;
|
||||||
FILE* err= NULL;
|
FILE* err;
|
||||||
|
|
||||||
// OS-dependent handle to the process
|
// OS-dependent handle to the process
|
||||||
uint32_t _proc_hdl = -1;
|
uint32_t _proc_hdl;
|
||||||
|
|
||||||
} uniproc_process;
|
} uniproc_process;
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ uniproc_process uniproc_create_process(const char* cmd, const size_t num_args, c
|
|||||||
for (size_t i = 0; i < num_args; ++i)
|
for (size_t i = 0; i < num_args; ++i)
|
||||||
cmd_len += strlen(argv[i]) + 1;
|
cmd_len += strlen(argv[i]) + 1;
|
||||||
char* p_cmd = malloc((cmd_len+1) * sizeof(char));
|
char* p_cmd = malloc((cmd_len+1) * sizeof(char));
|
||||||
|
p_cmd[x] = ' ';
|
||||||
memcpy(p_cmd, cmd, x * sizeof(char));
|
memcpy(p_cmd, cmd, x * sizeof(char));
|
||||||
x += 1; // Account for space after cmd
|
x += 1; // Account for space after cmd
|
||||||
for (size_t i = 0; i < num_args; ++i)
|
for (size_t i = 0; i < num_args; ++i)
|
||||||
@@ -51,7 +52,7 @@ uniproc_process uniproc_create_process(const char* cmd, const size_t num_args, c
|
|||||||
size_t arglen = strlen(argv[i]);
|
size_t arglen = strlen(argv[i]);
|
||||||
memcpy(p_cmd + x, argv[i], arglen);
|
memcpy(p_cmd + x, argv[i], arglen);
|
||||||
p_cmd[x + arglen] = ' ';
|
p_cmd[x + arglen] = ' ';
|
||||||
x += arglen + 1
|
x += arglen + 1;
|
||||||
}
|
}
|
||||||
p_cmd[cmd_len] = '\0';
|
p_cmd[cmd_len] = '\0';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user