lkml.org 
[lkml]   [1999]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject2.2.0: kernel strstr() is broken
Hi.

The strstr() function appears to be broken for i386 with 2.2.0,
which in turn, breaks IOMEGA ATAPI ZIP drive detection in ide-probe.c
(which relies on a strstr() during the probe).

For example, this code (inserted into the kernel):
{
static int done = 0;
static char buf[64];
if (!done++) {
strcpy(buf,"This is a ZIP test");
printk("buf at %p: \"%s\"\n", buf, buf);
printk("strstr(buf,\"XXX\") gives %p\n",
strstr(buf,"XXX"));
printk("strstr(buf,\"Thi\") gives %p\n",
strstr(buf,"Thi"));
printk("strstr(buf,\"est\") gives %p\n",
strstr(buf,"est"));
printk("strstr(buf,\"ZIP\") gives %p\n",
strstr(buf,"ZIP"));
}
}

gives this output:

Jan 20 18:02:21 foxy kernel: buf at c026de20: "This is a ZIP test"
Jan 20 18:02:21 foxy kernel: strstr(buf,"XXX") gives c026de20
Jan 20 18:02:21 foxy kernel: strstr(buf,"Thi") gives c026de20
Jan 20 18:02:21 foxy kernel: strstr(buf,"est") gives c026de20
Jan 20 18:02:21 foxy kernel: strstr(buf,"ZIP") gives c026de20

strstr() is broken.

--
mlord@pobox.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.017 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site