]> diplodocus.org Git - nmh/commitdiff
Alter HasSuffixC()'s char * to be const.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 23 Oct 2016 11:08:31 +0000 (12:08 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 24 Oct 2016 09:18:55 +0000 (10:18 +0100)
h/utils.h
sbr/utils.c

index 47ae59f..c8384b3 100644 (file)
--- a/h/utils.h
+++ b/h/utils.h
@@ -64,7 +64,7 @@ char *rfind_str (const char [], size_t, const char *);
 char *nmh_strcasestr (const char *, const char *);
 
 bool HasPrefix(const char *s, const char *prefix);
 char *nmh_strcasestr (const char *, const char *);
 
 bool HasPrefix(const char *s, const char *prefix);
-bool HasSuffixC(char *s, int c);
+bool HasSuffixC(const char *s, int c);
 void TrimSuffixC(char *s, int c);
 void ToLower(char *s);
 void ToUpper(char *s);
 void TrimSuffixC(char *s, int c);
 void ToLower(char *s);
 void ToUpper(char *s);
index a6f0e11..06835d2 100644 (file)
@@ -372,7 +372,7 @@ bool HasPrefix(const char *s, const char *prefix)
 
 /* HasSuffixC returns true if non-NULL string s ends with a c before the
  * terminating NUL. */
 
 /* HasSuffixC returns true if non-NULL string s ends with a c before the
  * terminating NUL. */
-bool HasSuffixC(char *s, int c)
+bool HasSuffixC(const char *s, int c)
 {
     return *s && s[strlen(s) - 1] == c;
 }
 {
     return *s && s[strlen(s) - 1] == c;
 }