From 03e05b41386fd5797cb8cd62eff7f0ba77c4e07e Mon Sep 17 00:00:00 2001 From: David Mosberger-Tang Date: Wed, 22 Aug 2007 12:57:49 -0600 Subject: [PATCH] Fix two minor compiler-warnings. --- src/os-linux.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/os-linux.h b/src/os-linux.h index 6a2b7dd7..57c57231 100644 --- a/src/os-linux.h +++ b/src/os-linux.h @@ -1,6 +1,7 @@ /* libunwind - a platform-independent unwind library Copyright (C) 2003-2004 Hewlett-Packard Co - Contributed by David Mosberger-Tang + Copyright (C) 2007 David Mosberger-Tang + Contributed by David Mosberger-Tang This file is part of libunwind. @@ -71,6 +72,7 @@ maps_init (struct map_iterator *mi, pid_t pid) mi->fd = open (path, O_RDONLY); mi->offset = 0; + mi->buf_size = 0; cp = NULL; if (mi->fd >= 0) @@ -233,7 +235,7 @@ maps_next (struct map_iterator *mi, mi->buf_size - bytes_left); if (nread <= 0) return 0; - else if (nread + bytes_left < mi->buf_size) + else if ((size_t) (nread + bytes_left) < mi->buf_size) { /* Move contents to the end of the buffer so we maintain the invariant that all bytes between