Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262696AbVBYNil (ORCPT ); Fri, 25 Feb 2005 08:38:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262697AbVBYNil (ORCPT ); Fri, 25 Feb 2005 08:38:41 -0500 Received: from inti.inf.utfsm.cl ([200.1.21.155]:19355 "EHLO inti.inf.utfsm.cl") by vger.kernel.org with ESMTP id S262696AbVBYNht (ORCPT ); Fri, 25 Feb 2005 08:37:49 -0500 Message-Id: <200502251337.j1PDbVbo005932@laptop11.inf.utfsm.cl> To: Brian Gerst cc: Andrew Morton , lkml Subject: Re: [PATCH] vsprintf.c cleanups In-Reply-To: Message from Brian Gerst of "Fri, 25 Feb 2005 07:28:20 CDT." <421F19E4.10600@didntduck.org> X-Mailer: MH-E 7.4.2; nmh 1.1; XEmacs 21.4 (patch 17) Date: Fri, 25 Feb 2005 10:37:31 -0300 From: Horst von Brand X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0b2 (inti.inf.utfsm.cl [200.1.21.155]); Fri, 25 Feb 2005 10:37:32 -0300 (CLST) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1111 Lines: 25 Brian Gerst said: > Horst von Brand wrote: > > Brian Gerst said: > > > >>- Make sprintf call vsnprintf directly > >>- use INT_MAX for sprintf and vsprintf > > This is the size limit on what is written. 4GiB sounds a bit extreme... > Sprintf has no limit, which is why it's generally bad to use it. I just > replaced an open coded ((~0U)>>1) value with the equivalent INT_MAX. Which is the same as "no limit" in my book. Either you know a limit (in which case vsprintf() is OK) or you don't (in which case vsnprintf() is just obfuscation). -- Dr. Horst H. von Brand User #22616 counter.li.org Departamento de Informatica Fono: +56 32 654431 Universidad Tecnica Federico Santa Maria +56 32 654239 Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/