aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-28 15:28:25 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-05-11 15:50:44 -0400
commit477c781679c774836493cb29b2191e3903000154 (patch)
tree0c05c2b163a19bb3f3427452591d65660830f684
parent4649a889a916aa377ebd3ca8f3daa9ac703baa34 (diff)
downloadstasis-477c781679c774836493cb29b2191e3903000154.tar.gz
call va_end
# Conflicts: # src/lib/core/utils.c
-rw-r--r--src/lib/core/utils.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/core/utils.c b/src/lib/core/utils.c
index 54c3dce..6b689c0 100644
--- a/src/lib/core/utils.c
+++ b/src/lib/core/utils.c
@@ -423,26 +423,28 @@ char *git_rev_parse(const char *path, char *args) {
}
void msg(unsigned type, char *fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+
FILE *stream = NULL;
char header[255];
char status[20];
if (type & STASIS_MSG_NOP) {
// quiet mode
+ va_end(args);
return;
}
if (!globals.verbose && type & STASIS_MSG_RESTRICT) {
// Verbose mode is not active
+ va_end(args);
return;
}
memset(header, 0, sizeof(header));
memset(status, 0, sizeof(status));
- va_list args;
- va_start(args, fmt);
-
stream = stdout;
fprintf(stream, "%s", STASIS_COLOR_RESET);
if (type & STASIS_MSG_ERROR) {
@@ -1000,7 +1002,7 @@ int grow(const size_t size_new, size_t *size_orig, char **data) {
}
if (size_new >= *size_orig) {
const size_t new_size = *size_orig + size_new + 1;
- SYSDEBUG("template data buffer new size: %zu", new_size);
+ SYSDEBUG("template data buffer new size: %zu\n", new_size);
char *tmp = realloc(*data, new_size);
if (!tmp) {
@@ -1188,7 +1190,7 @@ int get_random_bytes(char *result, size_t maxlen) {
if (filename != NULL) {
fp = fopen(filename, "rb");
if (!fp) {
- SYSERROR("unable to open random generator");
+ SYSERROR("%s", "unable to open random generator");
return -1;
}
}
@@ -1201,7 +1203,7 @@ int get_random_bytes(char *result, size_t maxlen) {
ch = rand() % 255;
}
if (fp && ferror(fp)) {
- SYSERROR("unable to read from random generator");
+ SYSERROR("%s", "unable to read from random generator");
fclose(fp);
return -1;
}