diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2024-10-07 12:59:43 +0100 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2024-10-07 12:59:43 +0100 |
commit | ce61e41c6a14b84808aceb37d5118f23e3affaa0 (patch) | |
tree | 8e6b7bea499ddd598c7096ef85e2aa19e85498b6 /comp/lucas-standen-NEA/code2/appendsnprintf.c | |
parent | 69c8e84587d934545bdb9d21b292463428ebee93 (diff) |
added comments to all of zpy and made the compiler have useful error msgs and for the most part not segv fault
Diffstat (limited to 'comp/lucas-standen-NEA/code2/appendsnprintf.c')
-rw-r--r-- | comp/lucas-standen-NEA/code2/appendsnprintf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/comp/lucas-standen-NEA/code2/appendsnprintf.c b/comp/lucas-standen-NEA/code2/appendsnprintf.c index ffa8349..a638c99 100644 --- a/comp/lucas-standen-NEA/code2/appendsnprintf.c +++ b/comp/lucas-standen-NEA/code2/appendsnprintf.c @@ -3,6 +3,7 @@ #include <stdlib.h> #include <string.h> +//# this function will generate the fmt specifier for appendsnprintf, should only be used for this use case char *genfmt(char *buf, char *fmt){ int len = strlen(buf) + strlen(fmt) + 1; char *out = malloc(len); @@ -21,6 +22,7 @@ char *genfmt(char *buf, char *fmt){ return out; } +//# this function will append size number of bytes, onto the end of buf, a format string in the form of vaargs char *appendsnprintf(char *buf, int size, char *format, ...){ va_list ap; char *outputbuf = malloc(size); |