1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00
putty-source/utils/host_strcspn.c

20 lines
360 B
C
Raw Permalink Normal View History

/*
* strcspn-like wrapper around host_strchr_internal.
*/
#include <stdbool.h>
#include <string.h>
#include "defs.h"
#include "misc.h"
#include "utils/utils.h"
size_t host_strcspn(const char *s, const char *set)
{
const char *answer = host_strchr_internal(s, set, true);
if (answer)
return answer - s;
else
return strlen(s);
}