summaryrefslogtreecommitdiff
path: root/src/stdio/sscanf_s.c
blob: 08bbd6e524c6eb5345a8b5c05bfa990c05ab1661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "_stdio.h"

/** read formatted input from a string **/
int sscanf_s(const char * restrict s, const char * restrict format, ...)
{
	SIGNAL_SAFE(0);
	ASSERT_NOOVERLAP(s, strlen(s), format, strlen(format));

	va_list ap;
	va_start(ap, format);
	int ret = vsscanf(s, format, ap);
	va_end(ap);
	return ret;
}

/***
The fn(sscanf) function reads formatted input from the string arg(s). The
format of arg(format) at the variadic arguments is the same as that for
fn(scanf).
***/

/* UNSPECIFIED: ??? */
/* UNDEFINED: ??? */
/* IMPLEMENTATION: ??? */
/* LOCALE: ??? */

/* RETURN(EOF): an input failure occurred */
/* RETURN: the number of input items assigned */

/*
CEXT1(201112)
*/