summarylogtreecommitdiffstats
path: root/gcc7.patch
blob: 3f254711487d0a31dc007ac8ddf71b19d04bbf81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 9da539016cb6c317388020f4ebce1793077aa126 Mon Sep 17 00:00:00 2001
From: Ryan Reno <ryan.reno@outlook.com>
Date: Fri, 23 Jun 2017 21:56:22 -0700
Subject: [PATCH] Changed comparions to remove compiler errors. In one case
 changed to compare against a NULL pointer and another, the pointer was
 dereferenced to compare against a char

---
 src/ApvlvCmds.cc      |   4 ++--
 src/ApvlvCore.cc      |   2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ApvlvCmds.cc b/src/ApvlvCmds.cc
index c7422f7..d4c40dd 100644
--- a/src/ApvlvCmds.cc
+++ b/src/ApvlvCmds.cc
@@ -192,7 +192,7 @@ namespace apvlv
   const char *ApvlvCmd::append (const char *s)
   {
     size_t len;
-    char *e;
+    char *e = strchr((char *)s, '>');
 
     len = strlen (s);
 
@@ -200,7 +200,7 @@ namespace apvlv
 
     if (len >= 4
 	&& *s == '<'
-	&& (e = strchr ((char *) s, '>')) != '\0' && *(s + 2) != '-')
+	&& (*e != '\0' && *(s + 2) != '-'))
       {
 	e++;
 	StringKeyMap::iterator it;
diff --git a/src/ApvlvCore.cc b/src/ApvlvCore.cc
index 672e5ef..e6e34f7 100644
--- a/src/ApvlvCore.cc
+++ b/src/ApvlvCore.cc
@@ -90,7 +90,7 @@ namespace apvlv
   {
     mInuse = use;
 
-    if (mInuse == false && gView->hasloaded (filename (), type ()) == false)
+    if (mInuse == false && gView->hasloaded (filename (), type ()) == NULL)
       {
 	debug ("core :%p is not needed, delete it\n", this);
 	delete this;