Page MenuHomePhabricator

Fix issue where message contained % but wasn't intended for use with parameters
ClosedPublic

Authored by hach-que on May 14 2014, 7:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 3:36 AM
Unknown Object (File)
Tue, Nov 19, 1:50 PM
Unknown Object (File)
Thu, Nov 14, 5:51 PM
Unknown Object (File)
Mon, Nov 11, 4:25 AM
Unknown Object (File)
Thu, Nov 7, 10:21 AM
Unknown Object (File)
Oct 22 2024, 2:41 PM
Unknown Object (File)
Oct 21 2024, 4:24 PM
Unknown Object (File)
Oct 21 2024, 9:40 AM
Subscribers

Details

Summary

This fixes an issue with the C# linter where a message could be returned from cslint that wasn't intended for use with parameters. This just ensures there's enough parameters so that it won't crash (and consequently ignore lint messages).

Test Plan

Ran the linter, it didn't crash.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

hach-que retitled this revision from to Fix issue where message contained % but wasn't intended for use with parameters.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: epriestley.

Is the "crash" a vsprintf() error raising into an exception? Can we do something like this instead?

$message = @vsprintf($pattern, ...);
if ($message === false) {
  $message = $pattern;
}

That will get a bunch of (probably hypothetical) cases right that this misses, I think.

hach-que edited edge metadata.

Feedback from code review

epriestley edited edge metadata.
This revision is now accepted and ready to land.May 15 2014, 12:11 AM
epriestley updated this revision to Diff 21682.
epriestley added a subscriber: Unknown Object (User).

Closed by commit rARCfcdacc28b8a2 (authored by @jamesr, committed by @epriestley).