Allow any variable-sized message

Signed-off-by: 0xf8 <0xf8.dev@proton.me>
This commit is contained in:
0xf8 2023-02-25 12:46:53 -05:00
parent 41db7a8c12
commit 740fcb11c2
Signed by: 0xf8
GPG Key ID: 446580D758689584

View File

@ -59,7 +59,12 @@ int main(int argc, char **argv) {
return 1; return 1;
} }
char *text = (char *)malloc(1024 + 1); uint reqSize = 0;
for (int i = 1; i < argc; i++) {
reqSize += strlen(argv[i]);
}
char *text = (char *)malloc(reqSize + argc);
// Adds all the arguments together with spaces seperating them // Adds all the arguments together with spaces seperating them
for (int i = 1, j = 0; i < argc; i++) { for (int i = 1, j = 0; i < argc; i++) {