chiark / gitweb /
[PATCH] fix stupid off-by-one bug that caused udevstart to die on x86-64 boxes.
authorgreg@kroah.com <greg@kroah.com>
Sat, 10 Jul 2004 01:46:08 +0000 (18:46 -0700)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:36:59 +0000 (21:36 -0700)
udevstart.c

index 19f588a..3ecfd4c 100644 (file)
@@ -228,7 +228,7 @@ static void udev_scan_class(void)
                                continue;
 
                        snprintf(dirname, MAX_PATHLEN, "%s/%s", SYSCLASS, dent->d_name);
-                       dirname[MAX_PATHLEN] = '\0';
+                       dirname[MAX_PATHLEN-1] = '\0';
                        dir2 = opendir(dirname);
                        if (dir2 != NULL) {
                                for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) {