From 2e0907ce624e2058bb31fab5ae565f413dbaf87f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 17 Apr 2020 16:18:07 -0400 Subject: move __string_read into vsscanf source file apparently this function was intended at some point to be used by strto* family as well, and thus was put in its own file; however, as far as I can tell, it's only ever been used by vsscanf. move it to the same file to reduce the number of source files and external symbols. --- src/stdio/__string_read.c | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 src/stdio/__string_read.c (limited to 'src/stdio/__string_read.c') diff --git a/src/stdio/__string_read.c b/src/stdio/__string_read.c deleted file mode 100644 index 7b50a7e1..00000000 --- a/src/stdio/__string_read.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "stdio_impl.h" -#include - -size_t __string_read(FILE *f, unsigned char *buf, size_t len) -{ - char *src = f->cookie; - size_t k = len+256; - char *end = memchr(src, 0, k); - if (end) k = end-src; - if (k < len) len = k; - memcpy(buf, src, len); - f->rpos = (void *)(src+len); - f->rend = (void *)(src+k); - f->cookie = src+k; - return len; -} -- cgit v1.2.1