iio: Accept a leading '+' sign when parsing fixed point numbers
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 22 Oct 2012 11:15:00 +0000 (12:15 +0100)
committerJonathan Cameron <jic23@kernel.org>
Fri, 2 Nov 2012 09:43:48 +0000 (09:43 +0000)
If we encounter a leading '+' sign just skip over it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/industrialio-core.c

index 7bb570b7a4af64f0bad899a23a2dcee3ba68cf85..cd700368eed064e3fadb0da8c0e0dc9a2d99be2c 100644 (file)
@@ -437,6 +437,8 @@ static ssize_t iio_write_channel_info(struct device *dev,
        if (buf[0] == '-') {
                negative = true;
                buf++;
+       } else if (buf[0] == '+') {
+               buf++;
        }
 
        while (*buf) {