A homeless man reportedly stabbed another man in a New York City library because he was viewing pornography, fire and police sources said.

The 56-year-old attacker was with his wife on the second floor of the Brooklyn Heights Branch of the Brooklyn Public Library when he spotted the video on the screen of a computer operated by a 52-year-old man Tuesday evening, sources told the New York Daily News.

“He was with his wife and he accused the other guy of looking at porn,” one police source said. “The guy looking at porn picked up a chair and hits him. The guy who was offended said, ‘I have a knife,' and stabs him in the chest.”

The victim, who remained conscious, was taken to Bellevue Hospital and is expected to survive the attack. Charges against the alleged stabber were pending late Tuesday, police told the newspaper.

Click for more from NYDailyNews.com.