All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] fix stroul endptr use
Date: Mon, 01 Mar 2004 23:14:41 +0000	[thread overview]
Message-ID: <20040301231441.GA6332@vrfy.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 81 bytes --]

The endptr is never NULL, so here we hopefully do the right thing.


thanks,
Kay

[-- Attachment #2: 01-stroul-fix.patch --]
[-- Type: text/plain, Size: 671 bytes --]

===== 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;

             reply	other threads:[~2004-03-01 23:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-01 23:14 Kay Sievers [this message]
2004-03-01 23:18 ` [PATCH] fix stroul endptr use Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040301231441.GA6332@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.