return (d - dst);
}
-gsize
-rspamd_strlcpy_tolower (gchar *dst, const gchar *src, gsize siz)
-{
- gchar *d = dst;
- const gchar *s = src;
- gsize n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0) {
- while (--n != 0) {
- if ((*d++ = g_ascii_tolower (*s++)) == '\0') {
- break;
- }
- }
- }
-
- if (n == 0 && siz != 0) {
- *d = '\0';
- }
-
- return (s - src - 1); /* count does not include NUL */
-}
-
/*
* Try to convert string of length to long
*/
*/
gsize rspamd_strlcpy (gchar *dst, const gchar *src, gsize siz);
-/**
- * Lowercase strlcpy variant
- * @param dst
- * @param src
- * @param siz
- * @return
- */
-gsize rspamd_strlcpy_tolower (gchar *dst, const gchar *src, gsize siz);
-
/*
* Try to convert string of length to long
*/