From 5e83fffdf28460325606d58c03694d6f70bba8c1 Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 13 Dec 2007 20:52:10 +0000 Subject: [PATCH] mmuhack.o path fix git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@312 be3aeb3a-fb24-0410-a615-afba39da0efa --- gp2x/squidgehack.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gp2x/squidgehack.c b/gp2x/squidgehack.c index 36e9bcb..28f997f 100644 --- a/gp2x/squidgehack.c +++ b/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); -- 2.39.5