Add VVV_fillstring()

This function is simple - it takes a given buffer and its size, fills it
with a certain character, and null-terminates it. It's meant to be used
with freshly-created buffers, so we don't copy-paste code.
This commit is contained in:
Misa
2021-04-11 17:19:53 -07:00
committed by Ethan Lee
parent eb9d3582d8
commit 5133d58777
2 changed files with 15 additions and 0 deletions

View File

@@ -28,6 +28,12 @@ bool is_positive_num(const char* str, const bool hex);
bool endsWith(const char* str, const char* suffix);
void VVV_fillstring(
char* buffer,
const size_t buffer_size,
const char fillchar
);
#define INBOUNDS_VEC(index, vector) ((int) index >= 0 && (int) index < (int) vector.size())
#define INBOUNDS_ARR(index, array) ((int) index >= 0 && (int) index < (int) SDL_arraysize(array))