From 1e5d4f9e0059dc2c7edb9e1adc1db7fc9b418a4b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 21 Jul 2021 20:28:21 -0700 Subject: [PATCH] remove now-unused sfio functionality for printing to strings Related to #1998. --- lib/sfio/sfio.h | 2 -- lib/sfio/sfprintf.c | 34 ---------------------------------- 2 files changed, 36 deletions(-) diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h index 5decb1e37..83536a864 100644 --- a/lib/sfio/sfio.h +++ b/lib/sfio/sfio.h @@ -208,8 +208,6 @@ extern "C" { extern ssize_t sfnputc(Sfio_t *, int, size_t); extern int sfungetc(Sfio_t *, int); extern int sfprintf(Sfio_t *, const char *, ...); - extern int sfsprintf(char *, int, const char *, ...); - extern int sfvsprintf(char *, int, const char *, va_list); extern int sfvprintf(Sfio_t *, const char *, va_list); extern int sfscanf(Sfio_t *, const char *, ...); extern int sfsscanf(const char *, const char *, ...); diff --git a/lib/sfio/sfprintf.c b/lib/sfio/sfprintf.c index d986948ea..e536de299 100644 --- a/lib/sfio/sfprintf.c +++ b/lib/sfio/sfprintf.c @@ -26,37 +26,3 @@ int sfprintf(Sfio_t * f, const char *form, ...) va_end(args); return rv; } - -int sfvsprintf(char *s, int n, const char *form, va_list args) -{ - Sfio_t f; - int rv; - - if (!s || n <= 0) - return -1; - - /* make a fake stream */ - SFCLEAR(&f); - f.flags = SF_STRING | SF_WRITE; - f.mode = SF_WRITE; - f.size = n - 1; - f.data = f.next = f.endr = (uchar *) s; - f.endb = f.endw = f.data + f.size; - - rv = sfvprintf(&f, form, args); - *f.next = '\0'; - _Sfi = f.next - f.data; - - return rv; -} - -int sfsprintf(char *s, int n, const char *form, ...) -{ - va_list args; - int rv; - va_start(args, form); - rv = sfvsprintf(s, n, form, args); - va_end(args); - - return rv; -} -- 2.40.0