From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27649 invoked by alias); 21 Nov 2010 07:32:29 -0000 Received: (qmail 27611 invoked by uid 22791); 21 Nov 2010 07:32:26 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 21 Nov 2010 06:16:23 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 4B3192F78005 for ; Sun, 21 Nov 2010 05:29:25 +0000 (GMT) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ruXOzkjlepCh; Sun, 21 Nov 2010 05:29:25 +0000 (GMT) From: bugzilla-daemon@bugs.ecos.sourceware.org To: ecos-bugs@ecos.sourceware.org Subject: [Bug 1000800] Diagnostics API does not include diag_vsnprintf X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Debugging X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jifl@ecoscentric.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: normal X-Bugzilla-Assigned-To: backlog@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: References: X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sun, 21 Nov 2010 07:32:00 -0000 Message-Id: <20101121052924.0A4812F78009@mail.ecoscentric.com> Mailing-List: contact ecos-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-bugs-owner@sourceware.org X-SW-Source: 2010/txt/msg00173.txt.bz2 Please do not reply to this email. Use the web interface provided at: http://bugs.ecos.sourceware.org/show_bug.cgi?id=1000800 --- Comment #9 from Jonathan Larmour 2010-11-21 05:29:20 GMT --- libc's snprintf is correct for ISO C99. Before C99, yes what you said would be right that the way most people implemented snprintf would mean snprintf's return value behaved similarly to sprintf's. But C99 changed things somewhat and said the return value would be the number of characters that would have been written if the 'n' argument was large enough. So you can detect a truncated write if the returned value is >= n. But diag_snprintf does not have to meet ISO C criteria - it's our own function and it is more important that it be simple. That said, it would be probably be wise to add a comment beside its prototype in diag.h noting this difference. -- Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.