[coreboot] need help with #define macro

Joseph Smith joe at settoplinux.org
Tue Dec 23 00:45:11 CET 2008




On Mon, 22 Dec 2008 17:54:08 +0100, Peter Stuge <peter at stuge.se> wrote:
> ron minnich wrote:
>> char *partport = "parport0";
>> static char parportname[MAXPATHLEN];
>>
>> sprintf(parportname, "/proc/sys/dev/parport/%s/base-addr", parport );
> 
> 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.
> 
Thanks for the tip Peter, I'll check this out.
-- 
Thanks,
Joseph Smith
Set-Top-Linux
www.settoplinux.org





More information about the coreboot mailing list