[openbeosnetteam] Re: snprintf

> > Metrowerks stdlib, for reasons I can't even begin to fathom, 
> > doesn't 
> > have snprintf(). Therefore, I have been doing things like this when 
> > I 
> > run across one:
> > #ifdef _MWERKS_STDIO_H
> >     sprintf(buf,"%s.%s",a,b);
> > #else
> >     snprintf(buf,255,"%s.%s",a,b);
> > #endif
> > 
> > Is this all right?
> 
> I would like something like
> #ifdef _MWERKS_STDIO_H
> void
> snprintf(char *buf,...)
> {
>       ...
> }
> #endif
> 
> in *one* place more. The Metrowerks "port" is just an intermediate 
> thing, so there is no need to flood the code with unsafe things like 
> this.

I'm not familiar with ... syntax, so I have no idea how to do an 
snprintf implementation. Any suggestions?
-Nathan 


--
Fortune Cookie Says:

.. indifference is a militant thing ... when it goes away it leaves
smoking ruins, where lie citizens bayonetted through the throat.  It is
not a children's pastime like mere highway robbery.
                -- Stephen Crane


Other related posts: