[coreboot] need help with #define macro

Peter Stuge peter at stuge.se
Mon Dec 22 18:19:03 CET 2008

ron minnich wrote:
> > Please make sure to always use
> >
> > snprintf(parportname, sizeof(parportname), "/proc/...", parport);
> >
> > to avoid buffer overflows, and check the return value. Not that I
> > always do, but I should.
> arg! good point. I have gotten out of the habit of using any of
> these, as Plan 9 has this:
> smprint(format, ...)
> smprint mallocs the buffer as needed.

It's asprintf in GNU.

> snprintf now feels SOOO 20th-century, as my daughter might say :-)

It still makes sense in loops, to avoid overhead.


More information about the coreboot mailing list