64f10b4687eae05cf0f5ce9986b40c164d6ea8bc hiram Tue Feb 14 11:31:03 2017 -0800 add description to searchTrix results refs #13673 diff --git src/inc/common.h src/inc/common.h index 230d0a8..c30ab89 100644 --- src/inc/common.h +++ src/inc/common.h @@ -1351,30 +1351,38 @@ boolean fileExists(char *fileName); /* Does a file exist? */ /* Friendly name for strstrNoCase */ char *containsStringNoCase(char *haystack, char *needle); char *strstrNoCase(char *haystack, char *needle); /* A case-insensitive strstr */ int vasafef(char* buffer, int bufSize, char *format, va_list args); /* Format string to buffer, vsprintf style, only with buffer overflow * checking. The resulting string is always terminated with zero byte. */ +int vatruncatef(char *buf, int size, char *format, va_list args); +/* Like vasafef, but truncates the formatted string instead of barfing on + * overflow. */ + +void truncatef(char *buf, int size, char *format, ...); +/* Like safef, but truncates the formatted string instead of barfing on + * overflow. */ + int safef(char* buffer, int bufSize, char *format, ...) /* Format string to buffer, vsprintf style, only with buffer overflow * checking. The resulting string is always terminated with zero byte. */ #ifdef __GNUC__ __attribute__((format(printf, 3, 4))) #endif ; void safecpy(char *buf, size_t bufSize, const char *src); /* copy a string to a buffer, with bounds checking.*/ void safencpy(char *buf, size_t bufSize, const char *src, size_t n); /* copy n characters from a string to a buffer, with bounds checking. * Unlike strncpy, always null terminates the result */