[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1235769813.26788.391.camel@nimitz>
Date: Fri, 27 Feb 2009 13:23:33 -0800
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: Vegard Nossum <vegard.nossum@...il.com>
Cc: containers <containers@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
hch@...radead.org, Ingo Molnar <mingo@...e.hu>,
Alexey Dobriyan <adobriyan@...il.com>
Subject: Re: [RFC][PATCH 2/8] breakout fdinfo sprintf() into its own
function
On Fri, 2009-02-27 at 21:56 +0100, Vegard Nossum wrote:
> > +static void proc_fd_write_info(struct file *file, char *info)
> > +{
> > + int max = PROC_FDINFO_MAX;
> > + int p = 0;
> > + if (!info)
> > + return;
> > +
> > + p += snprintf(info+p, max-p, "pos:\t%lli\n", (long long) file->f_pos);
> > + p += snprintf(info+p, max-p, "flags:\t0%o\n", file->f_flags);
>
> Actually, snprintf() is not the right function to use here.
> scnprintf(), perhaps?
Yes, that does look more appropriate. I'll double-check what happens
when we overrun the buffer.
-- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists