summaryrefslogtreecommitdiff
path: root/overlay
diff options
context:
space:
mode:
Diffstat (limited to 'overlay')
-rw-r--r--overlay/config.c1
-rw-r--r--overlay/gem-objects.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/overlay/config.c b/overlay/config.c
index 56e0147a..b6bd8dc3 100644
--- a/overlay/config.c
+++ b/overlay/config.c
@@ -196,6 +196,7 @@ static int add_value(const char *section,
return 0;
memcpy(s->name, section, len);
+ s->values = NULL;
s->next = c->sections;
c->sections = s;
}
diff --git a/overlay/gem-objects.c b/overlay/gem-objects.c
index d5044bc0..4d60299a 100644
--- a/overlay/gem-objects.c
+++ b/overlay/gem-objects.c
@@ -57,12 +57,16 @@ int gem_objects_init(struct gem_objects *obj)
fd = open(buf, 0);
if (fd < 0)
return errno;
- len = read(fd, buf, sizeof(buf)-1);
+ len = read(fd, buf+1, sizeof(buf)-2);
close(fd);
if (len < 0)
return EIO;
+ /* Add sentinel values for the string searches */
+ buf[0] = '\n';
+ buf[len+1] = '\0';
+
b = strstr(buf, "gtt total");
if (b == NULL)
return EIO;