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)
Fri, May 3, 2:51 AM
Unknown Object (File)
Mon, Apr 29, 2:04 PM
Unknown Object (File)
Wed, Apr 24, 10:17 PM
Unknown Object (File)
Sun, Apr 21, 4:19 PM
Unknown Object (File)
Wed, Apr 17, 2:15 PM
Unknown Object (File)
Fri, Apr 12, 1:43 PM
Unknown Object (File)
Feb 22 2024, 1:02 PM
Unknown Object (File)
Feb 5 2024, 3:38 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).