From commits-return-2798-apmail-stdcxx-commits-archive=stdcxx.apache.org@stdcxx.apache.org Tue Apr 22 23:39:05 2008 Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 19803 invoked from network); 22 Apr 2008 23:39:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Apr 2008 23:39:05 -0000 Received: (qmail 73312 invoked by uid 500); 22 Apr 2008 23:39:06 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 73293 invoked by uid 500); 22 Apr 2008 23:39:06 -0000 Mailing-List: contact commits-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list commits@stdcxx.apache.org Received: (qmail 73278 invoked by uid 99); 22 Apr 2008 23:39:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2008 16:39:06 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2008 23:38:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 204FF1A9832; Tue, 22 Apr 2008 16:38:42 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r650698 - /stdcxx/branches/4.2.x/tests/src/cmdopt.cpp Date: Tue, 22 Apr 2008 23:38:41 -0000 To: commits@stdcxx.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080422233842.204FF1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebor Date: Tue Apr 22 16:38:40 2008 New Revision: 650698 URL: http://svn.apache.org/viewvc?rev=650698&view=rev Log: 2008-04-22 Martin Sebor STDCXX-754 * tests/src/cmdopt.cpp (rw_vsetopts): Handled malloc() failure. Added an assertion to silence a bogus HP aCC 6/cadvise warning #20200-D: Potential null pointer dereference. Unfortunately, with the one gone another bogus one pops up... Modified: stdcxx/branches/4.2.x/tests/src/cmdopt.cpp Modified: stdcxx/branches/4.2.x/tests/src/cmdopt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/cmdopt.cpp?rev=650698&r1=650697&r2=650698&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/src/cmdopt.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/cmdopt.cpp Tue Apr 22 16:38:40 2008 @@ -20,7 +20,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 2005-2006 Rogue Wave Software. + * Copyright 2005-2008 Rogue Wave Software, Inc. * **************************************************************************/ @@ -518,6 +518,8 @@ lopt = lastopt->loptbuf_; else { lopt = (char*)malloc (optlen + 1); + if (0 == lopt) + return -1; // error lastopt->lopt_ = lopt; } @@ -533,6 +535,8 @@ lastopt->maxcount_ = 1; int arg_is_callback = true; + + RW_ASSERT (0 != next); if ('#' == *next) { // examples of option specification: