From 88d0bd390877adb7beb1fd45b815ca4b31450cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 29 Aug 2009 08:20:18 +0200 Subject: [PATCH] astyle --- src/checkmemoryleak.cpp | 2 +- test/testmemleak.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkmemoryleak.cpp b/src/checkmemoryleak.cpp index 5d625dbd3..63b4b9cba 100644 --- a/src/checkmemoryleak.cpp +++ b/src/checkmemoryleak.cpp @@ -764,7 +764,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::liststr() == "if") { - if (alloctype == Fd && + if (alloctype == Fd && (Token::Match(tok, "if ( %varid% >= 0 )", varid) || Token::Match(tok, "if ( %varid% != -1 )", varid))) { diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 2c8f6ac0c..1dcb90188 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -355,7 +355,7 @@ private: ASSERT_EQUALS(";;alloc;", getcode("char *s; asprintf(&s, \"s: %s\", s);", "s")); ASSERT_EQUALS(";;;", getcode("char *s; asprintf(&p, \"s: %s\", s);", "s")); - // Since we don't check how the return value is used we must bail out + // Since we don't check how the return value is used we must bail out ASSERT_EQUALS("", getcode("char *s; int ret = asprintf(&s, \"xyz\");", "s")); TODO_ASSERT_EQUALS(";;alloc;", getcode("char *s; int ret; ret=asprintf(&s, \"xyz\"); if (ret==-1) return;", "s"));