summaryrefslogtreecommitdiffstats
path: root/sandbox/linux/suid/linux_util.c
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 22:53:51 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 22:53:51 +0000
commit95250e4c742d27fad6e4bb737a8110a4ee63323c (patch)
tree4878d3c58b349177498802d89cb4a86bc5180147 /sandbox/linux/suid/linux_util.c
parentc9fe2cd069cc6f00ece6765c29cefb24a8276d71 (diff)
downloadchromium_src-95250e4c742d27fad6e4bb737a8110a4ee63323c.zip
chromium_src-95250e4c742d27fad6e4bb737a8110a4ee63323c.tar.gz
chromium_src-95250e4c742d27fad6e4bb737a8110a4ee63323c.tar.bz2
linux: turn on -Wextra
This is a followup to an earlier change (r38266) which did most of the warning-related cleanup. This one just flips the flag, and fixes some new warnings that crept in during the window while the flag was off. BUG=34160 Review URL: http://codereview.chromium.org/597023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/linux/suid/linux_util.c')
-rw-r--r--sandbox/linux/suid/linux_util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sandbox/linux/suid/linux_util.c b/sandbox/linux/suid/linux_util.c
index ded545b..c5af0d0 100644
--- a/sandbox/linux/suid/linux_util.c
+++ b/sandbox/linux/suid/linux_util.c
@@ -83,8 +83,9 @@ bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode) {
continue;
while ((dent = readdir(fd))) {
- if (snprintf(buf, sizeof(buf), "/proc/%lu/fd/%s", pid_ul,
- dent->d_name) >= sizeof(buf) - 1) {
+ int printed = snprintf(buf, sizeof(buf), "/proc/%lu/fd/%s", pid_ul,
+ dent->d_name);
+ if (printed < 0 || printed >= (int)(sizeof(buf) - 1)) {
continue;
}