From 1953fe43689054aded03eb166f4f987e7cc0dccd Mon Sep 17 00:00:00 2001
From: Dan McGee <dan@archlinux.org>
Date: Tue, 1 Nov 2011 19:17:26 -0500
Subject: Fix thinko in _alpm_strip_newline
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The point of this early compare to NULL byte check was so we could bail
early and skip the strcmp() call. Given we weren't doing the check
right, this never exited early. Fix it to work as intended.

Noticed-by: Pepe Juárez <trulustapa@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
---
 lib/libalpm/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'lib/libalpm')

diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 12286c6a..fbb320ef 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -221,7 +221,7 @@ char *_alpm_strtrim(char *str)
 size_t _alpm_strip_newline(char *str)
 {
 	size_t len;
-	if(str == '\0') {
+	if(*str == '\0') {
 		return 0;
 	}
 	len = strlen(str);
-- 
cgit v1.2.3-70-g09d2