[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: quik kernel size limit



On  14 Oct, this message from Sven Luther echoed through cyberspace:
>> Incidentaly, there's a bug in second/file.c, in load_file(), where a
>> device path is predefined as '/dev/sdaX', 'X' being replaced later
>> with partno+'0', thus limiting working partition numbers to 1-9, and
>> overwriting the terminating \0 on larger partition numbers.
> 
> That would be good if it was fixed, or at least properly documented.

Since we're already at patching quik, how about this to remove that bug:

diff -uNr quik-2.0e-orig/second/file.c quik-2.0e/second/file.c
--- quik-2.0e-orig/second/file.c        Sun Oct 12 13:46:52 2003
+++ quik-2.0e/second/file.c     Thu Oct 16 21:08:01 2003
@@ -389,13 +389,14 @@
 {
     ext2_ino_t inode;
     int retval;
-    char bogusdev[] = "/dev/sdaX";
+    char bogusdev[11];
 
     if (device == 0)
        device = bootdevice;
     if (setdisk(device) < 0)
        return 0;
-    bogusdev[8] = partno + '0';
+    partno &= 0xf;
+    sprintf(bogusdev, "/dev/sda%d", partno);
     filebuffer = buffer;
     filelimit = limit;
     decompress = dogunzip & 1;

Chris, since you're rebuilding quik :-), maybe you can give this a try
as well?

Cheers

Michel

PS By the way, why is Cort Dougan's BitKeeper config file included in
quik's source?

-------------------------------------------------------------------------
Michel Lanners                 |  " Read Philosophy.  Study Art.
23, Rue Paul Henkes            |    Ask Questions.  Make Mistakes.
L-1710 Luxembourg              |
email   mlan@cpu.lu            |
http://www.cpu.lu/~mlan        |                     Learn Always. "



Reply to: