Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37759794
en ru br
Репозитории ALT

Группа :: Издательство
Пакет: paps

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: FC-fix-loop-in-split.patch
Скачать


From 6c3fa9959dd454938378ade2fec8e84cee7d6916 Mon Sep 17 00:00:00 2001
From: Akira TAGOH <tagoh@redhat.com>
Date: Tue, 27 Jul 2010 12:19:30 +0900
Subject: [PATCH 1/2] Fix rhbz#618483: texttopaps becoms runaway memory hog
        * src/paps.c (split_text_into_paragraphs): fix a infinite loop
        when non-printable characters are in the text.
---
 src/paps.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
 	* paps.c: Erased --justify option since it is not implemented in 
diff --git a/src/paps.c b/src/paps.c
index 72dbaad..dcef349 100644
--- a/src/paps.c
+++ b/src/paps.c
@@ -835,7 +835,10 @@ split_text_into_paragraphs (PangoContext *pango_context,
 				      goto fail;
 			      }
 			      for (i = 0; i < len; i++) {
-				      wwidth += wcwidth(wtext[i]);
+				      gssize w = wcwidth(wtext[i]);
+
+				      if (w >= 0)
+					      wwidth += w;
 				      if (wwidth > col)
 					      break;
 				      wnewtext[i] = wtext[i];
-- 
1.7.1.1
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin