|
From: Lasse Kärkkäi. <tr...@us...> - 2010-06-13 22:55:45
|
Module: performous
Branch: master
Commit: 201e1b830283960d07fa6a5b6db237667b49930f
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jun 14 01:55:31 2010 +0300
Fix bug in alsa.hpp causing it to loop indefinitely when PRETTY_FUNCTION was not formatted as expected (affects clang).
---
libs/libda/plugins/alsa/alsa.hpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libs/libda/plugins/alsa/alsa.hpp b/libs/libda/plugins/alsa/alsa.hpp
index 918abbc..492b2e1 100644
--- a/libs/libda/plugins/alsa/alsa.hpp
+++ b/libs/libda/plugins/alsa/alsa.hpp
@@ -257,7 +257,8 @@ namespace alsa {
std::string::size_type end = prettyfunc.find('(');
std::string::size_type begin = prettyfunc.find(' ');
if (begin == std::string::npos || begin > end) begin = 0; else ++begin;
- for (std::string::size_type tmp; (tmp = prettyfunc.rfind(' ', end)) != std::string::npos && tmp > begin; end = tmp) {};
+ if (end == std::string::npos) end = prettyfunc.size();
+ for (std::string::size_type tmp; end > begin && (tmp = prettyfunc.rfind(' ', end - 1)) != std::string::npos && tmp > begin; end = tmp) {};
throw error(cfunc, ret, prettyfunc.substr(begin, end - begin));
}
}
|