chiark / gitweb /
fix unquoted strings in udevinitsend
authorKay Sievers <kay.sievers@suse.de>
Thu, 7 Jul 2005 14:02:03 +0000 (16:02 +0200)
committerKay Sievers <kay.sievers@suse.de>
Thu, 7 Jul 2005 14:02:03 +0000 (16:02 +0200)
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
udevinitsend.c

index 26ae5c8..204e9ce 100644 (file)
@@ -132,11 +132,11 @@ static int udevsend(char *filename, int sock, int disable_loop_detection)
                        strncpy(&usend_msg.envbuf[bufpos],ls,(ch - ls) + 1);
                        bufpos += (ch - ls) + 1;
                        if (ch[1] == '\'' && le[-1] == '\'') {
-                               strncpy(&usend_msg.envbuf[bufpos],ch + 2, (le - ch) -3);
+                               strncpy(&usend_msg.envbuf[bufpos],ch + 2, (le - ch) - 3);
                                bufpos += (le - ch) - 3;
                        } else {
-                               strncpy(&usend_msg.envbuf[bufpos],ch, (le - ch));
-                               bufpos += (le - ch);
+                               strncpy(&usend_msg.envbuf[bufpos],ch + 1, (le - ch) - 1);
+                               bufpos += (le - ch) - 1;
                        }
                        bufpos++;
                }