]> diplodocus.org Git - nmh/blobdiff - h/utils.h
fgets() reserves space for the NUL itself.
[nmh] / h / utils.h
index c8384b3921dd7981db70359c80bc8204b3e8c2ef..939bd80eabe200c28503edc254ccdf0a9f346349 100644 (file)
--- a/h/utils.h
+++ b/h/utils.h
@@ -63,7 +63,12 @@ char *find_str (const char [], size_t, const char *);
 char *rfind_str (const char [], size_t, const char *);
 char *nmh_strcasestr (const char *, const char *);
 
+void trunccpy(char *dst, const char *src, size_t size);
+/* A convenience for the common case of dst being an array. */
+#define TRUNCCPY(dst, src) trunccpy(dst, src, sizeof (dst))
+
 bool HasPrefix(const char *s, const char *prefix);
+bool HasSuffix(const char *s, const char *suffix);
 bool HasSuffixC(const char *s, int c);
 void TrimSuffixC(char *s, int c);
 void ToLower(char *s);