diff --git a/public/crtlib.c b/public/crtlib.c index 5fd339a0..e53cccd4 100644 --- a/public/crtlib.c +++ b/public/crtlib.c @@ -320,7 +320,9 @@ const char* Q_timestamp( int format ) // Build a timestamp that can use for filename (ex: "Nov2006-26 (19.14.28)"); strftime( timestamp, sizeof( timestamp ), "%b%Y-%d_%H.%M.%S", crt_tm ); break; - default: return NULL; + default: + Q_snprintf( timestamp, sizeof( timestamp ), "%s: unknown format %d", __func__, format ); + break; } return timestamp; diff --git a/public/crtlib.h b/public/crtlib.h index ef0f717f..2356d195 100644 --- a/public/crtlib.h +++ b/public/crtlib.h @@ -78,7 +78,7 @@ qboolean Q_stricmpext( const char *pattern, const char *text ); qboolean Q_strnicmpext( const char *pattern, const char *text, size_t minimumlen ); const byte *Q_memmem( const byte *haystack, size_t haystacklen, const byte *needle, size_t needlelen ); void Q_memor( byte *XASH_RESTRICT dst, const byte *XASH_RESTRICT src, size_t len ); -const char *Q_timestamp( int format ); +const char *Q_timestamp( int format ) RETURNS_NONNULL; int Q_vsnprintf( char *buffer, size_t buffersize, const char *format, va_list args ); int Q_snprintf( char *buffer, size_t buffersize, const char *format, ... ) FORMAT_CHECK( 3 ); #define Q_strpbrk strpbrk @@ -86,7 +86,7 @@ void COM_StripColors( const char *in, char *out ); #define Q_memprint( val ) Q_pretifymem( val, 2 ) char *Q_pretifymem( float value, int digitsafterdecimal ); void COM_FileBase( const char *in, char *out, size_t size ); -const char *COM_FileExtension( const char *in ); +const char *COM_FileExtension( const char *in ) RETURNS_NONNULL; void COM_DefaultExtension( char *path, const char *extension, size_t size ); void COM_ReplaceExtension( char *path, const char *extension, size_t size ); void COM_ExtractFilePath( const char *path, char *dest );