summaryrefslogtreecommitdiff
path: root/libmailutils/string/strsuf.c
blob: 273d2f641927563916414334565bd562438ee306 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <config.h>
#include <string.h>
#include <mailutils/cstr.h>

int
mu_string_suffix (char const *str, char const *sfx)
{
  size_t sfxlen = strlen (sfx);
  size_t len = strlen (str); 
  if (len < sfxlen)
    return 0;
  return memcmp (str + len - sfxlen, sfx, sfxlen) == 0;
}

Return to:

Send suggestions and report system problems to the System administrator.