From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Mon, 01 Mar 2004 23:14:41 +0000 Subject: [PATCH] fix stroul endptr use Message-Id: <20040301231441.GA6332@vrfy.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="opJtzjQTFsWo+cga" List-Id: To: linux-hotplug@vger.kernel.org --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The endptr is never NULL, so here we hopefully do the right thing. thanks, Kay --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="01-stroul-fix.patch" ===== klibc_fixups.c 1.6 vs edited ===== --- 1.6/klibc_fixups.c Sun Feb 29 05:51:47 2004 +++ edited/klibc_fixups.c Mon Mar 1 23:59:53 2004 @@ -74,7 +74,7 @@ if (strcmp(uname, name) == 0) { id = strtoul(idstr, &tail, 10); - if (tail == NULL) + if (tail[0] != '\0') id = -1; else dbg("id for '%s' is '%li'", name, id); ===== namedev.c 1.120 vs edited ===== --- 1.120/namedev.c Sat Feb 28 22:51:04 2004 +++ edited/namedev.c Tue Mar 2 00:02:05 2004 @@ -198,7 +198,7 @@ if (isdigit(*str[0])) { num = (int) strtoul(*str, &tail, 10); - if (tail != NULL) { + if (num > 0) { *str = tail; dbg("format length=%i", num); return num; --opJtzjQTFsWo+cga-- ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel