vsprintf considered dangerous

Ray Butterworth rbutterworth at watmath.waterloo.edu
Tue Apr 26 00:19:50 AEST 1988


In article <2543 at geac.UUCP>, daveb at geac.UUCP (David Collier-Brown) writes:
> In article <18746 at think.UUCP> bromley at lysippe.think.com.UUCP (Mark Bromley) writes:
> | I have always disliked the sprintf and sscanf interface.  A somewhat different
> | interface would allow the standard functions to be used with complete error
> | checking in the case of io to/from strings.  
> If memory serves, one can do this on Honeywell GCOS machines,
> although probably only in "B" and not "C".  And no, I have no idea
> why...

The GCOS B and C libraries both take the fopen parameters
"ws", "rs", and "as", to mean that the "file-name" parameter is
really a pointer to an actual string to be written, read, or
appended to.  Unfortunately there is no check for overflow.



More information about the Comp.lang.c mailing list