1 /* 2 * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #include <sys/cdefs.h> 8 9 /* 10 * TODO: This is not a real implementation of the sscanf() function. It just 11 * returns the number of expected arguments based on the number of '%' found 12 * in the format string. 13 */ 14 int 15 sscanf(const char *__restrict str, char const *__restrict fmt, ...) 16 { 17 int ret = 0; 18 19 while (*fmt != '\0') { 20 if (*fmt++ == '%') { 21 ret++; 22 } 23 } 24 25 return ret; 26 } 27