From: Ali Saidi Date: Thu, 10 May 2012 23:04:27 +0000 (-0500) Subject: mem: fix bug with CopyStringOut and null string termination. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=041b93242883dc604f193e912497350f55800ee3;p=gem5.git mem: fix bug with CopyStringOut and null string termination. --- diff --git a/src/mem/fs_translating_port_proxy.cc b/src/mem/fs_translating_port_proxy.cc index bf0c076c6..9f1f7d019 100644 --- a/src/mem/fs_translating_port_proxy.cc +++ b/src/mem/fs_translating_port_proxy.cc @@ -140,7 +140,7 @@ CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen) bool foundNull = false; while ((dst - start + 1) < maxlen && !foundNull) { vp.readBlob(vaddr++, (uint8_t*)dst, 1); - if (dst == '\0') + if (*dst == '\0') foundNull = true; dst++; }