From ebf536a7910f6e8d5bff569d2d717287ad3ba716 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Sat, 18 Oct 2025 03:40:40 -0300 Subject: properly handle NULL values with postgres result helpers --- src/querymanager.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/querymanager.cc') diff --git a/src/querymanager.cc b/src/querymanager.cc index 983e65f..56df1f8 100644 --- a/src/querymanager.cc +++ b/src/querymanager.cc @@ -243,9 +243,9 @@ bool StringFormatTime(char *Dest, int DestCapacity, const char *Format, int Time struct tm tm = GetLocalTime((int)Timestamp); int Result = (int)strftime(Dest, DestCapacity, Format, &tm); - // NOTE(fusion): `strftime` will should return ZERO if it's unable to fit - // the result in the supplied buffer, which is annoying because ZERO may - // not represent a failure if the result is an empty string. + // NOTE(fusion): `strftime` will return ZERO if it's unable to fit the result + // in the supplied buffer, which is annoying because ZERO may not represent a + // failure if the result is an empty string. ASSERT(Result >= 0 && Result < DestCapacity); if(Result == 0){ memset(Dest, 0, DestCapacity); -- cgit v1.2.3