From: notaz Date: Thu, 13 Dec 2007 20:52:10 +0000 (+0000) Subject: mmuhack.o path fix X-Git-Tag: v1.85~607 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=047db02217aca2879886504b97549cdbb15a056c;p=picodrive.git mmuhack.o path fix git-svn-id: file:///home/notaz/opt/svn/PicoDrive@312 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/platform/gp2x/squidgehack.c b/platform/gp2x/squidgehack.c index 36e9bcbe..28f997fa 100644 --- a/platform/gp2x/squidgehack.c +++ b/platform/gp2x/squidgehack.c @@ -22,14 +22,13 @@ int mmuhack(void) strcpy(kocmd, "/sbin/insmod "); strncpy(kocmd+13, g_argv[0], 1023-13); kocmd[1023] = 0; - for (i = strlen(kocmd); i > 0; i--) - if (kocmd[i] == '/') { kocmd[i] = 0; break; } - strcat(kocmd, "/mmuhack.o"); + for (i = strlen(kocmd); i > 13; i--) + if (kocmd[i] == '/') { i++; break; } + strcpy(kocmd+i, "mmuhack.o"); printf("Installing NK's kernel module for Squidge MMU Hack (%s)...\n", kocmd); system(kocmd); mmufd = open("/dev/mmuhack", O_RDWR); - if(mmufd < 0) return 0; close(mmufd);