Skip to content

Commit b2443a0

Browse files
committed
Merge pull request #7 from msoucy/master
wattrset return value
2 parents bf0f5b6 + d4a7dfe commit b2443a0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

deimos/ncurses/curses.d

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,12 @@ int wattron(W:WINDOW, N:chtype)(W* win, N attrs)
811811
{ return wattr_on(win, cast(attr_t)attrs, null); }
812812
int wattroff(W:WINDOW, N:chtype)(W* win, N attrs)
813813
{ return wattr_off(win, attrs, null); }
814-
N wattrset(W:WINDOW, N:chtype)(W* win, N attrs)
815-
{ return win.attrs = attrs; }
814+
int wattrset(W:WINDOW, N:chtype)(W* win, N attrs)
815+
{
816+
if(win == null) return ERR;
817+
win.attrs = attrs;
818+
return OK;
819+
}
816820
int wattr_get(W:WINDOW, A:attr_t, S:short, V:void)
817821
(W* win, A* attrs, S* pair, V* opts)
818822
{

0 commit comments

Comments
 (0)