Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: How to predict size of outcome of vsprintf? Message-ID: <1989Mar20.044625.9256@utzoo.uucp> Organization: U of Toronto Zoology References: <993@etnibsd.UUCP> <9872@smoke.BRL.MIL> <1618@thor.acc.stolaf.edu> Date: Mon, 20 Mar 89 04:46:25 GMT In article <1618@thor.acc.stolaf.edu> mike@stolaf.edu writes: > int snprintf(char *str, size_t len, const char *fmt, ...); > int vsnprintf(char *str, size_t len, const char *fmt, va_list ap); > >that do bounds checking on their output. Richard Stallman suggested to >ANSI that they include such routines in the C standard; I am of the >impression that various other people independently made the same or a >similar suggestion... This is correct. >I do not understand why the pANS does not address this problem in some way. Two reasons: 1. Lack of prior experience with it. Believe it or not, standards committees are supposed to be consolidating existing, proven practices, not endorsing new and untested ideas. X3J11, while not perfect, has done much better in this area than a lot of other language committees. This is a feature, not a bug! 2. The fact that most of the proposals came very late in the standardization process, when quite strong majorities were required to add new stuff. I have been told that at least one attempt to add snprintf and friends failed by one or two votes. -- Welcome to Mars! Your | Henry Spencer at U of Toronto Zoology passport and visa, comrade? | uunet!attcan!utzoo!henry henry@zoo.toronto.edu