[OpenAFS] sprintf -> snprintf...

Joshua Johnson joshua.johnson@ftlsys.com
Thu, 26 Jun 2003 14:39:33 -0500


--On Thursday, June 26, 2003 11:06:52 AM -0700 Russ Allbery 
<rra@stanford.edu> wrote:

> Joshua Johnson <joshua.johnson@ftlsys.com> writes:
>
>> 	A quick look into the systems I have access to shows that snprintf
>> 	is stock on:
<<snip>>
> Given the widespread lack of compliance of snprintf, you may want to just
> always use your own.  If this is for user-space code, you can use the
> attached Autoconf probe to see if the platform has a working snprintf.

OK, <boot to the head over C99 semantics etc. etc.>...point taken.

>
> I'm not entirely sure where you got your snprintf from; I have another
> version with slightly different floating point support (it doesn't use the
> native sprintf and is therefore safe, but it doesn't work for floating
> point numbers whose integer component won't fit into the largest available
> integer type) that's used for INN and wget, among other packages.  Let me
> know if you want a copy.


I have found quite a few options if we go this route I'd be happy to help 
code to whatever the group decides.


(--Userspace only discussion begin ...)

OK, well maybe someone has an opinion on something like trio.

http://daniel.haxx.se/trio/

Edit(Macro) the stdio string funtion calls (printf, scanf, strcpy, etc. 
etc. ), and go for it.

And minimize a lot of this probing #ifdef'ing etc. etc.

It does imply a dependency on another package (license seems OK) and 
contains ~12.5K src lines.  But it beats re-creating the wheel(and gives 
more than just snprintf) and does seem embarassingly simple to build,test, 
and install.


(--Userspace end...)


Kernelspace is another matter and I yeild to the people mucking through 
that already.
Maybe there isn't a lot of this in kernelspace ??  I haven't looked enough 
yet.


>
> Here's the Autoconf probe:

<<snip>>
Thanks

> --
> Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
>
> _______________________________________________
> OpenAFS-info mailing list
> OpenAFS-info@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-info