Falling oil prices and a surprise announcement from Hewlett-Packard weighed on technology and energy stocks Tuesday.
HP plunged 11.95 percent after executives said that a company HP bought for nearly $10 billion last year lied about its finances. CEO Meg Whitman said that there were "serious accounting improprieties" at the search-engine company, Autonomy.
To account for it, HP took an $8.8 billion charge in its latest quarter. HP's stock lost $1.59 to $11.71.
A warning from Federal Reserve chairman Ben Bernanke about the dangers of the "fiscal cliff" also weighed on the market in afternoon trading. The Dow Jones industrial average dropped as much as 94 points shortly after Bernanke spoke.
But the stock market crept higher and ended the day flat. The Dow dropped 7.45 points to close at 12,788.51.
The Standard & Poor's 500 index gained 0.07 percent to 1,387.81. The Nasdaq composite index gained 0.02 percent to 2,916.68.
Energy stocks and the price of crude oil fell after the president of Egypt predicted that Israel's weeklong offensive in the Gaza Strip would end in hours and the Israeli prime minister said Israel would be a "willing partner" to a cease-fire. -- AP