From 85a3c08c0496a22a01ea12aff9fdc959356e8b37 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 1 Jan 2012 04:24:45 -0600 Subject: Fix potential crash --- kio/kio/kfileitem.cpp | 14 ++++++++------ kio/kio/kurifilter.cpp | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'kio') diff --git a/kio/kio/kfileitem.cpp b/kio/kio/kfileitem.cpp index e74b407be..38e3c0e3c 100644 --- a/kio/kio/kfileitem.cpp +++ b/kio/kio/kfileitem.cpp @@ -674,12 +674,14 @@ TQPixmap KFileItem::pixmap( int _size, int _state ) const { // Failed to obtain a list of ELF icons } - while((entry = get_nexticon(&icons, entry)) != NULL) - { - if (KGlobal::iconLoader()->iconPath(entry->name, 0, true) != "") { - iconresnamefound = 1; - p = DesktopIcon( entry->name, _size, _state ); - break; + else { + while((entry = get_nexticon(&icons, entry)) != NULL) + { + if (KGlobal::iconLoader()->iconPath(entry->name, 0, true) != "") { + iconresnamefound = 1; + p = DesktopIcon( entry->name, _size, _state ); + break; + } } } diff --git a/kio/kio/kurifilter.cpp b/kio/kio/kurifilter.cpp index f6910e6a1..f16e0db7d 100644 --- a/kio/kio/kurifilter.cpp +++ b/kio/kio/kurifilter.cpp @@ -222,12 +222,14 @@ TQString KURIFilterData::iconName() { // Failed to obtain a list of ELF icons } - while((entry = get_nexticon(&icons, entry)) != NULL) - { - if (KGlobal::iconLoader()->iconPath(entry->name, 0, true) != "") { - iconresnamefound = 1; - m_strIconName = entry->name; - break; + else { + while((entry = get_nexticon(&icons, entry)) != NULL) + { + if (KGlobal::iconLoader()->iconPath(entry->name, 0, true) != "") { + iconresnamefound = 1; + m_strIconName = entry->name; + break; + } } } -- cgit v1.2.1