diff options
author | David Goulet <dgoulet@torproject.org> | 2021-03-10 10:04:26 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-03-10 10:04:26 -0500 |
commit | fc080b4113c769bd75b81ef4ba571c8df96f5a7b (patch) | |
tree | 5e8c9235adb4a0dfb26f7b4d20ebd88352350d27 /src | |
parent | 05564a852110c0c908b03acba57d3b7b8dc222b4 (diff) | |
parent | 690c7be2537dc30be2d1f4978af7df77c46c2782 (diff) | |
download | tor-fc080b4113c769bd75b81ef4ba571c8df96f5a7b.tar.gz tor-fc080b4113c769bd75b81ef4ba571c8df96f5a7b.zip |
Merge branch 'maint-0.4.5'
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/meminfo/.may_include | 1 | ||||
-rw-r--r-- | src/lib/meminfo/meminfo.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/meminfo/.may_include b/src/lib/meminfo/.may_include index 9e4d25fd6a..12fe36d134 100644 --- a/src/lib/meminfo/.may_include +++ b/src/lib/meminfo/.may_include @@ -5,4 +5,5 @@ lib/fs/*.h lib/log/*.h lib/malloc/*.h lib/meminfo/*.h +lib/string/*.h lib/testsupport/*.h diff --git a/src/lib/meminfo/meminfo.c b/src/lib/meminfo/meminfo.c index b7d991e410..77da579f99 100644 --- a/src/lib/meminfo/meminfo.c +++ b/src/lib/meminfo/meminfo.c @@ -17,6 +17,7 @@ #include "lib/fs/files.h" #include "lib/log/log.h" #include "lib/malloc/malloc.h" +#include "lib/string/util_string.h" #ifdef HAVE_FCNTL_H #include <fcntl.h> @@ -65,7 +66,7 @@ get_total_system_memory_impl(void) s = read_file_to_str_until_eof(fd, 65536, &file_size); if (!s) goto err; - cp = strstr(s, "MemTotal:"); + cp = find_str_at_start_of_line(s, "MemTotal:"); if (!cp) goto err; /* Use the system sscanf so that space will match a wider number of space */ |