Date: Thu, 12 Nov 2009 03:12:51 GMT From: Jeremy Huddleston <jeremyhu@apple.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/140497: Maintainance update for sscanf.c Message-ID: <200911120312.nAC3CpXY014117@www.freebsd.org> Resent-Message-ID: <200911120320.nAC3K1Uw075116@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 140497 >Category: misc >Synopsis: Maintainance update for sscanf.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 12 03:20:00 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Jeremy Huddleston >Release: 8.0 >Organization: Apple >Environment: NA >Description: Make sscanf use vsscanf like similar changes to other stdio functions. >How-To-Repeat: >Fix: --- sscanf.c.bsdnew 2009-11-11 19:10:07.000000000 -0800 +++ sscanf.c 2009-11-11 19:11:21.000000000 -0800 @@ -41,37 +41,14 @@ __FBSDID("$FreeBSD: src/lib/libc/stdio/s #include <stdarg.h> #include "local.h" -static int eofread(void *, char *, int); - -/* ARGSUSED */ -static int -eofread(cookie, buf, len) - void *cookie; - char *buf; - int len; -{ - - return (0); -} - int sscanf(const char * __restrict str, char const * __restrict fmt, ...) { int ret; va_list ap; - FILE f; - f._file = -1; - f._flags = __SRD; - f._bf._base = f._p = (unsigned char *)str; - f._bf._size = f._r = strlen(str); - f._read = eofread; - f._ub._base = NULL; - f._lb._base = NULL; - f._orientation = 0; - memset(&f._mbstate, 0, sizeof(mbstate_t)); va_start(ap, fmt); - ret = __svfscanf(&f, fmt, ap); + ret = vsscanf(str, fmt, ap); va_end(ap); return (ret); } >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911120312.nAC3CpXY014117>