[webkit-reviews] review granted: [Bug 174506] -Wformat-truncation warning in ConfigFile.cpp : [Attachment 315473] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jul 15 08:23:26 PDT 2017


Darin Adler <darin at apple.com> has granted Michael Catanzaro
<mcatanzaro at igalia.com>'s request for review:
Bug 174506: -Wformat-truncation warning in ConfigFile.cpp
https://bugs.webkit.org/show_bug.cgi?id=174506

Attachment 315473: Patch

https://bugs.webkit.org/attachment.cgi?id=315473&action=review




--- Comment #7 from Darin Adler <darin at apple.com> ---
Comment on attachment 315473
  --> https://bugs.webkit.org/attachment.cgi?id=315473
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=315473&action=review

> Source/JavaScriptCore/runtime/ConfigFile.cpp:288
> +		       if (written < 0 || static_cast<unsigned>(written) >=
s_maxPathLength + 1)

The "written < 0" check here is redundant. If it is true, then the other check
is also guaranteed to be true.

Also, ">= s_maxPathLength + 1" is the same thing as "> s_maxPathLength" and the
version with >= and +1 seems more oblique.


More information about the webkit-reviews mailing list