mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
20 lines
360 B
C
20 lines
360 B
C
|
/*
|
||
|
* 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);
|
||
|
}
|