diff options
author | John Tytgat <joty@netsurf-browser.org> | 2004-08-26 22:58:19 +0000 |
---|---|---|
committer | John Tytgat <joty@netsurf-browser.org> | 2004-08-26 22:58:19 +0000 |
commit | f34a485dc6fb38e1c2dd23704891fb81f53a06cb (patch) | |
tree | b934beed8cae798059d194b57d8f3692281d78b8 | |
parent | e44249f6edb3781ebc6816e79791ba266a568935 (diff) | |
download | netsurf-f34a485dc6fb38e1c2dd23704891fb81f53a06cb.tar.gz netsurf-f34a485dc6fb38e1c2dd23704891fb81f53a06cb.tar.bz2 |
[project @ 2004-08-26 22:58:19 by joty]
warn_user() : made warn_buffer static local.
die() : a too long error message is now correctly NUL terminated; got rid of static variable.
svn path=/import/netsurf/; revision=1251
-rw-r--r-- | riscos/gui.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/riscos/gui.c b/riscos/gui.c index 43c06ede6..732adb472 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -1454,8 +1454,6 @@ void gui_launch_url(const char *url) } -static char warn_buffer[300]; - /** * Display a warning for a serious problem (eg memory exhaustion). * @@ -1465,6 +1463,8 @@ static char warn_buffer[300]; void warn_user(const char *warning, const char *detail) { + static char warn_buffer[300]; + LOG(("%s %s", warning, detail)); snprintf(warn_buffer, sizeof warn_buffer, "%s %s", messages_get(warning), @@ -1479,9 +1479,6 @@ void warn_user(const char *warning, const char *detail) } -static os_error warn_error = { 1, "" }; - - /** * Display an error and exit. * @@ -1490,7 +1487,12 @@ static os_error warn_error = { 1, "" }; void die(const char *error) { - strncpy(warn_error.errmess, messages_get(error), 252); + os_error warn_error; + + warn_error.errnum = 1; /* \todo: reasonable ? */ + strncpy(warn_error.errmess, messages_get(error), + sizeof(warn_error.errmess)-1); + warn_error.errmess[sizeof(warn_error.errmess)-1] = '\0'; xwimp_report_error_by_category(&warn_error, wimp_ERROR_BOX_OK_ICON | wimp_ERROR_BOX_GIVEN_CATEGORY | |