]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix cu3088 group write
authorGuillaume Morin <guillaume@morinfr.org>
Sun, 31 Aug 2003 08:41:18 +0000 (01:41 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 31 Aug 2003 08:41:18 +0000 (01:41 -0700)
The current cu3088 ccwgroup write code overwrite the last char of the
given arguments.  This fixes the problem.  It is been tested and applies
on latest bk.

drivers/s390/net/cu3088.c

index a92b4cc8d3e7c2720250704d0affe09da2405ef2..ed2cecfd4708a7bfa798d1e42f908eb5d5ca967a 100644 (file)
@@ -64,7 +64,7 @@ static ssize_t
 group_write(struct device_driver *drv, const char *buf, size_t count)
 {
        const char *start, *end;
-       char bus_ids[2][BUS_ID_SIZE], *argv[2];
+       char bus_ids[2][BUS_ID_SIZE+1], *argv[2];
        int i;
        int ret;
        struct ccwgroup_driver *cdrv;
@@ -79,7 +79,7 @@ group_write(struct device_driver *drv, const char *buf, size_t count)
 
                if (!(end = strchr(start, delim[i])))
                        return count;
-               len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start);
+               len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start)+1;
                strlcpy (bus_ids[i], start, len);
                argv[i] = bus_ids[i];
                start = end + 1;