cppcheck nullPointerOutOfMemory

This commit is contained in:
Philippe Teuwen committed 2025-03-24 23:46:43 +01:00
1 parent e42932738e
commit ad84875afd
44 files changed
+314 -5

No files matched your search

+6
View File
@@ -59,6 +59,12 @@ static void AppendDate(char *s, size_t slen, const char *fmt) {
#else
ct = gmtime_r(&now, &tm_buf);
#endif
if (ct == NULL) {
PrintAndLogEx(ERR, "gmtime failed");
return;
}
// If no format is specified, use ISO8601
if (fmt == NULL)
strftime(s, slen, "%Y-%m-%dT%H:%M:%SZ", ct); // ISO8601
else