summaryrefslogtreecommitdiff
path: root/desktop/browser_history.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-10-29 22:14:48 +0000
committerVincent Sanders <vince@kyllikki.org>2014-10-29 22:29:06 +0000
commita221fa721360e4aef1488eddc4891e10c26cb73d (patch)
tree08312f5f7b4e20ead32c028fad0e31293b2195f0 /desktop/browser_history.c
parent847e1111bce323ba5277c4babf70c5441233bcd7 (diff)
downloadnetsurf-a221fa721360e4aef1488eddc4891e10c26cb73d.tar.gz
netsurf-a221fa721360e4aef1488eddc4891e10c26cb73d.tar.bz2
Ensure browser window creation returns errors from common initialisation.
The browser window common initialisation code returns error codes which were being ignored. The errors were additionally being reported via warn_user in inappropriate places within browser history construction.
Diffstat (limited to 'desktop/browser_history.c')
-rw-r--r--desktop/browser_history.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 445c0ee06..309bcb2b4 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -416,9 +416,9 @@ static bool browser_window_history__enumerate_entry(
/**
* Create a new history tree for a browser window window.
*
- * \param bw browser window to create history for.
+ * \param bw browser window to create history for.
*
- * \return NSERROR_OK or appropriate error otherwise
+ * \return NSERROR_OK or appropriate error otherwise
*/
nserror browser_window_history_create(struct browser_window *bw)
@@ -428,10 +428,10 @@ nserror browser_window_history_create(struct browser_window *bw)
bw->history = NULL;
history = calloc(1, sizeof *history);
- if (!history) {
- warn_user("NoMemory", 0);
+ if (history == NULL) {
return NSERROR_NOMEM;
}
+
history->width = RIGHT_MARGIN / 2;
history->height = BOTTOM_MARGIN / 2;
@@ -473,7 +473,6 @@ nserror browser_window_history_clone(const struct browser_window *existing,
new_history->start);
if (!new_history->start) {
LOG(("Insufficient memory to clone history"));
- warn_user("NoMemory", 0);
browser_window_history_destroy(clone);
clone->history = NULL;
return NSERROR_NOMEM;