Adam Wainwright allowed four hits over 7 2/3 innings, Matt Carpenter continued to feast on San Francisco pitching and the St. Louis Cardinals ended a scoring drought, beating the Giants 2-0 on Wednesday night.