home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a3f3ab5
)
Repaired erroneous previous commit and added check for validity of draw function...
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 8 Sep 2013 13:03:50 +0000
(15:03 +0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 8 Sep 2013 13:03:50 +0000
(15:03 +0200)
src/wincontrol.c
patch
|
blob
|
history
diff --git
a/src/wincontrol.c
b/src/wincontrol.c
index ba397721ae25c8a97d50497653fe374307d3b243..d4f01f8ba3d4ca6578d218713e5570092c89d4aa 100644
(file)
--- a/
src/wincontrol.c
+++ b/
src/wincontrol.c
@@
-55,11
+55,11
@@
static void set_winconf(struct World * world, char id);
/* Get WinConf by "id"; get id of WinConf mothering "win". */
static struct WinConf * get_winconf_by_id(struct World * world, char id);
/* Get WinConf by "id"; get id of WinConf mothering "win". */
static struct WinConf * get_winconf_by_id(struct World * world, char id);
-/* Get
window draw functin (Win->_draw) identified by "c"
. */
-static void * get_drawfunc_by_char(char c)
+/* Get
(Win->_draw) function identified by "c"; NULL if c not mapped to one
. */
+static void * get_drawfunc_by_char(char c)
;
/* Iterate over bytes of world->winconf_ids array. Re-start after null byte. */
/* Iterate over bytes of world->winconf_ids array. Re-start after null byte. */
-static char get_next_winconf_id(struct World * world)
+static char get_next_winconf_id(struct World * world)
;
@@
-123,12
+123,17
@@
static void init_winconf_from_file(struct World * world, char id)
static void init_win_from_winconf(struct World * world, char id)
{
static void init_win_from_winconf(struct World * world, char id)
{
- char * err = "Trouble in init_win_from_file() with init_win().";
+ char * tmp = "Trouble in init_win_from_file() with init_win() (win id: _).";
+ char * err = try_malloc(strlen(tmp) + 1, world, "init_win_from_file()");
+ memcpy(err, tmp, strlen(tmp) + 1);
+ err[strlen(tmp) - 3] = id;
struct WinConf * winconf = get_winconf_by_id(world, id);
struct WinConf * winconf = get_winconf_by_id(world, id);
+ void * f = get_drawfunc_by_char(winconf->draw);
+ exit_err(NULL == f, world, err);
exit_err(init_win(world->wmeta, &winconf->win, winconf->title,
exit_err(init_win(world->wmeta, &winconf->win, winconf->title,
- winconf->height, winconf->width, world,
- get_drawfunc_by_char(winconf->draw)),
+ winconf->height, winconf->width, world, f),
world, err);
world, err);
+ free(err);
}
}
@@
-449,7
+454,7
@@
extern void toggle_winconfig(struct World * world, struct Win * win)
}
else
{
}
else
{
- win->_draw = get_drawfunc_by_char(wcp->draw);
// wcp->draw;
+ win->_draw = get_drawfunc_by_char(wcp->draw);
wcp->view = 0;
}
}
wcp->view = 0;
}
}