projects
/
dana
/
openbox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bcb8de9
)
return a NULL instead of segfaulting when asserts are off
author
Dana Jansens
<danakj@orodu.net>
Wed, 25 Dec 2002 00:26:54 +0000
(
00:26
+0000)
committer
Dana Jansens
<danakj@orodu.net>
Wed, 25 Dec 2002 00:26:54 +0000
(
00:26
+0000)
src/openbox.hh
patch
|
blob
|
history
diff --git
a/src/openbox.hh
b/src/openbox.hh
index 40eb1804c3052ac401060249f284c19e40f1aa75..1489ffb744b1af37301053cbf99b5a3f794529cb 100644
(file)
--- a/
src/openbox.hh
+++ b/
src/openbox.hh
@@
-171,9
+171,16
@@
public:
//! Returns a managed screen
inline OBScreen *screen(int num) {
assert(num >= 0); assert(num < (signed)_screens.size());
+ if (num >= screenCount())
+ return NULL;
return _screens[num];
}
+ //! Returns the number of managed screens
+ inline int screenCount() const {
+ return (signed)_screens.size();
+ }
+
//! Returns the mouse cursors used throughout Openbox
inline const Cursors &cursors() const { return _cursors; }