[Webkit-unassigned] [Bug 52585] REGRESSION(r75709): Return value of fscanf() shouldn't be ignored.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jan 17 12:49:19 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=52585
--- Comment #5 from Csaba Osztrogonac <ossy at webkit.org> 2011-01-17 12:49:19 PST ---
452 static void maybeModifyVMPoolSize()
453 {
454 FILE* fp = fopen("/proc/sys/vm/overcommit_memory", "r");
455 if (!fp)
456 return;
457
458 unsigned overcommit = 0;
459 fscanf(fp, "%u", &overcommit);
Here the return value of fscanf must be true, so we
can ignore it here, but we shouldn't do it in general.
I think the similar "check" to http://trac.webkit.org/changeset/66984 would be good:
+ // We have to use the return value of fwrite to avoid "ignoring return value" gcc warning
+ // See https://bugs.webkit.org/show_bug.cgi?id=45384 for details.
- fscanf(fp, "%u", &overcommit);
+ if (fscanf(fp, "%u", &overcommit)) {}
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list