diff options
author | Anton L. Šijanec <sijanecantonluka@gmail.com> | 2020-05-16 19:35:55 +0200 |
---|---|---|
committer | Anton L. Šijanec <sijanecantonluka@gmail.com> | 2020-05-16 19:35:55 +0200 |
commit | 587f44fd93a0024500418ce25bf01d0f177644f4 (patch) | |
tree | 13a981e5bc369cca8cc99ad9547d54b4c76673f5 /lib/joinarrays.c | |
parent | fix to allow nested commands (diff) | |
download | bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.gz bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.bz2 bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.lz bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.xz bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.tar.zst bverbose-587f44fd93a0024500418ce25bf01d0f177644f4.zip |
Diffstat (limited to '')
-rw-r--r-- | lib/joinarrays.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/joinarrays.c b/lib/joinarrays.c new file mode 100644 index 0000000..22070b0 --- /dev/null +++ b/lib/joinarrays.c @@ -0,0 +1,18 @@ +#pragma once +#include <bvr.h> +// do not use this, this is idiotic, use strlcpy +char * join_null_terminated_arrays(char * a1, char * a2) { // returns null terminated array + char sizeof0 = BVR_VALUE_CHUNK_SIZE; + char * a0 = malloc(sizeof(char) * sizeof0); + char i = 0; + char position = 0; + while(a1[i] != 0) { + a0[position++] = a1[i++]; + } + i = 0; + while(a2[i] != 0) { + a0[position++] = a2[i++]; + } + a0[position++] = 0; + return a0; +} |