Index: lib/sdk/crt/time/strftime.c =================================================================== --- lib/sdk/crt/time/strftime.c (revision 37626) +++ lib/sdk/crt/time/strftime.c (working copy) @@ -233,6 +233,9 @@ char *x; char *f; size_t i,j; + /* when maxsize is zero just return with zero */ + if ((gsize = maxsize) < 1) + return 0; x = malloc(maxsize); j = wcslen(format); f = malloc(j+1); @@ -240,8 +243,6 @@ f[i] = (char)*format; f[i] = 0; pt = x; - if ((gsize = maxsize) < 1) - return 0; if (_fmt(f, t)) { *pt = '\0'; free(f);