On Mon, 22 Dec 2008 17:54:08 +0100, Peter Stuge peter@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.