Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: sandbox/linux/suid/linux_util.c

Issue 597023: linux: turn on -Wextra (Closed)
Patch Set: more Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/seccomp/socketcall.cc ('k') | sandbox/linux/suid/process_util_linux.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/suid/linux_util.c
diff --git a/sandbox/linux/suid/linux_util.c b/sandbox/linux/suid/linux_util.c
index ded545bdbab51f596dd3c6f695374b2d2af6b60c..c5af0d0d1dc9672abdf324774e95013ab5f1e55e 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;
}
« no previous file with comments | « sandbox/linux/seccomp/socketcall.cc ('k') | sandbox/linux/suid/process_util_linux.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698