[lib] terminate the words fetched by get_word()
authorChristophe Varoqui <christophe.varoqui@free.fr>
Thu, 23 Oct 2008 20:47:20 +0000 (22:47 +0200)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Thu, 23 Oct 2008 20:47:20 +0000 (22:47 +0200)
get_word is used to parse words from device maps and status
for example. Not terminating these words ended up with unpleasant
outputs.

libmultipath/util.c

index c7fe6b4..57b2a2d 100644 (file)
@@ -95,6 +95,7 @@ get_word (char * sentence, char ** word)
                return 0;
        }
        strncpy(*word, sentence, len);
+       strchop(*word);
        condlog(4, "*word = %s, len = %i", *word, len);
 
        if (*p == '\0')