summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2004-12-09 19:09:56 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2004-12-09 19:09:56 +0000
commit441b364600c8ec4f1fc2e8afacada78b2e352421 (patch)
tree369ceeb26e8e573f788db435036c9ec4c91cde1e /riscos
parentbd652a750a60fa7a6d4d2d5e3deff97eda07b135 (diff)
downloadnetsurf-441b364600c8ec4f1fc2e8afacada78b2e352421.tar.gz
netsurf-441b364600c8ec4f1fc2e8afacada78b2e352421.tar.bz2
[project @ 2004-12-09 19:09:56 by rjw]
Lose xcalloc(). svn path=/import/netsurf/; revision=1397
Diffstat (limited to 'riscos')
-rw-r--r--riscos/filetype.c15
-rw-r--r--riscos/uri.c2
2 files changed, 14 insertions, 3 deletions
diff --git a/riscos/filetype.c b/riscos/filetype.c
index 5ce3dd0e5..13b2f9aca 100644
--- a/riscos/filetype.c
+++ b/riscos/filetype.c
@@ -49,11 +49,16 @@ const char *fetch_filetype(const char *unix_path)
{
struct type_entry *t;
unsigned int len = strlen(unix_path) + 100;
- char *path = xcalloc(len, 1);
+ char *path = calloc(len, 1);
char *r;
os_error *error;
bits file_type;
+ if (!path) {
+ LOG(("Insuficient memory for calloc"));
+ warn_user("NoMemory", 0);
+ return "application/riscos";
+ }
LOG(("unix_path = '%s'", unix_path));
/* convert path to RISC OS format and read file type */
@@ -84,7 +89,13 @@ char *fetch_mimetype(const char *ro_path) {
os_error *e;
bits filetype = 0, load;
int objtype;
- char *mime = xcalloc(256, sizeof(char));
+ char *mime = calloc(256, sizeof(char));
+
+ if (!mime) {
+ LOG(("Insuficient memory for calloc"));
+ warn_user("NoMemory", 0);
+ return 0;
+ }
e = xosfile_read_no_path(ro_path, &objtype, &load, 0, 0, 0);
if (e) return 0;
diff --git a/riscos/uri.c b/riscos/uri.c
index 035fa59f2..04edc208f 100644
--- a/riscos/uri.c
+++ b/riscos/uri.c
@@ -48,7 +48,7 @@ void ro_uri_message_received(uri_full_message_process* uri_message)
uri_message->sender);
xuri_request_uri(0, 0, 0, uri_handle, &uri_length);
- uri_requested = xcalloc((unsigned int)uri_length, sizeof(char));
+ uri_requested = calloc((unsigned int)uri_length, sizeof(char));
if (uri_requested == NULL)
return;