From 1b05a8aa813c45bf3fb8a1232c0234b6fb8a2f47 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 20 Oct 2020 23:31:25 +0200 Subject: Minor things. --- stc/cfmt.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stc/cfmt.h b/stc/cfmt.h index d0d86026..2e82ca6a 100644 --- a/stc/cfmt.h +++ b/stc/cfmt.h @@ -115,11 +115,10 @@ _cfmt_printf(int s, const char* fmt, ...) { #if !defined(STC_HEADER) || defined(STC_IMPLEMENTATION) #include -#include STC_DEF char * _cfmt_conv(const char *fmt, ...) { - char *fmt2 = strcpy((char *) malloc(strlen(fmt) * 2), fmt), *p = fmt2, *f, ch; + char *fmt2 = strcpy((char *) malloc(strlen(fmt)*2 + 1), fmt), *p = fmt2, *f, ch; va_list args; va_start(args, fmt); do { -- cgit v1.2.3