On Tue, Jan 08, 2008 at 07:16:24PM -0500, Thomas Dickey wrote: > On Tue, Jan 08, 2008 at 05:42:31PM +0100, Jiri Moskovcak wrote: > > Hi, > > I'm maintainer of Lynx package for Fedora and I found a bug in > > implementation of StrAllocVsprintf() - it seems that it can't handle > > formatting string like %2$s and it crashes with this message: > > *** invalid %N$ use detected *** I can fix the crash, but real fix will > > probably require to rewrite bigger part of that function. So I'd like to > > ask if someone can take a look at it. > > Attaching the change I just checked-in (will be in dev.8)
...to explain a little: when I wrote HTSprintf/etc in 1998 (and with KW, modified them in 1999), vasprintf, asprintf, etc were available only as undocumented functions in glibc (read: Linux-specific). I'd added a configure check for it, thinking to revisit that if needed (or if it were standard enough to rely on). According to the manpage that's available with *BSD now. It won't work for older Unix's (perhaps not even newer ones). The "2$" is a feature not in c99 which is (according to the manpage on Linux) part of POSIX 2001.something. It's used only in lynx's message files (and I'd overlooked that detail). The quick fix simply uses vasprintf where it exists - and that in turn (Linux, *BSD) will presumably get the "2$" feature since the respective systems claim to support it. -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net _______________________________________________ Lynx-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lynx-dev
