From 89faa8faac6fb336b44eb5e4a815218f0ac50084 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Tue, 2 May 2017 10:25:08 +0200 Subject: Properly initialize heap to avoid malloc failures --- frontends/kolibrios/fb/gui.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'frontends/kolibrios/fb/gui.c') diff --git a/frontends/kolibrios/fb/gui.c b/frontends/kolibrios/fb/gui.c index fbaf36f54..d12bdfcf0 100644 --- a/frontends/kolibrios/fb/gui.c +++ b/frontends/kolibrios/fb/gui.c @@ -492,7 +492,7 @@ process_cmdline(int argc, char** argv) /* Remove me! */ feurl = "http://www.kolibrios.org"; - + /* NS on KolibriOS does not support option parsing (yet) */ /* while((opt = getopt_long(argc, argv, "f:b:w:h:", */ @@ -2139,15 +2139,16 @@ MKARGV(ARGC, "\0"); char *respath = strdup(argv[0]); for(int i = strlen(respath) - 1; i > 0; i--) { if(respath[i] == '/') { - strcpy((respath+i), "res"); + strcpy((respath+i+1), "res"); break; } } + /* Skip the encoding bytes */ + respath+=2; ret = netsurf_register(&framebuffer_table); if (ret != NSERROR_OK) die("NetSurf operation table failed registration"); - respaths = fb_init_resource(respath); /* initialise logging. Abort on failure for KolibriOS. */ @@ -2160,6 +2161,8 @@ MKARGV(ARGC, "\0"); if (ret != NSERROR_OK) die("Options failed to initialise"); + LOG("Resources are at : %s", respath); + options = filepath_find(respaths, "Choices"); nsoption_read(options, nsoptions); free(options); -- cgit v1.2.3