diff options
| author | EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> | 2021-09-07 17:17:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-07 18:17:19 +0200 |
| commit | b1cd46c37c3d446d97dfb29d1f1bc920973358c2 (patch) | |
| tree | 2c8f0ae315a29ea7d4e96403582937388765f8f5 /src/code | |
| parent | c577ed1e84bc1b6137adcef459e18d5224c0e4aa (diff) | |
Add `va_end` and returns to variadic functions (#950)
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/fault_drawer.c | 4 | ||||
| -rw-r--r-- | src/code/gfxprint.c | 7 | ||||
| -rw-r--r-- | src/code/printutils.c | 7 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/code/fault_drawer.c b/src/code/fault_drawer.c index 2a875ae5d..0885cacbd 100644 --- a/src/code/fault_drawer.c +++ b/src/code/fault_drawer.c @@ -272,6 +272,8 @@ void FaultDrawer_Printf(const char* fmt, ...) { va_start(args, fmt); FaultDrawer_VPrintf(fmt, args); + + va_end(args); } void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) { @@ -280,6 +282,8 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) { FaultDrawer_SetCursor(x, y); FaultDrawer_VPrintf(fmt, args); + + va_end(args); } void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) { diff --git a/src/code/gfxprint.c b/src/code/gfxprint.c index 3dc385edf..b526de9be 100644 --- a/src/code/gfxprint.c +++ b/src/code/gfxprint.c @@ -357,8 +357,13 @@ s32 GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) { } s32 GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) { + s32 ret; va_list args; va_start(args, fmt); - return GfxPrint_VPrintf(this, fmt, args); + ret = GfxPrint_VPrintf(this, fmt, args); + + va_end(args); + + return ret; } diff --git a/src/code/printutils.c b/src/code/printutils.c index 1df6a4bfc..3fb8cf367 100644 --- a/src/code/printutils.c +++ b/src/code/printutils.c @@ -5,8 +5,13 @@ s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args) { } s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...) { + s32 ret; va_list args; va_start(args, fmt); - return PrintUtils_VPrintf(pfn, fmt, args); + ret = PrintUtils_VPrintf(pfn, fmt, args); + + va_end(args); + + return ret; } |
