[multipathd] fix occasional CLI output trailing garbage
authorroot <root@potab.(none)>
Wed, 17 Aug 2005 16:16:46 +0000 (18:16 +0200)
committerroot <root@potab.(none)>
Wed, 17 Aug 2005 16:16:46 +0000 (18:16 +0200)
caused by an off-by-one reply len calculation in show_paths()
and show_maps()

multipathd/main.c

index c47e17c..114ab46 100644 (file)
@@ -717,7 +717,7 @@ show_paths (char ** r, int * len, struct paths * allpaths)
        }
 
        *r = reply;
-       *len = (int)(c - reply);
+       *len = (int)(c - reply + 1);
        return 0;
 }
 
@@ -761,7 +761,7 @@ show_maps (char ** r, int *len, struct paths * allpaths)
        }
 
        *r = reply;
-       *len = (int)(c - reply);
+       *len = (int)(c - reply + 1);
        return 0;
 }