From: Hannes Reinecke Date: Fri, 14 Nov 2008 09:02:56 +0000 (+0100) Subject: libmultipath: zero out lines in print.c X-Git-Tag: 0.4.9~108 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ff6c45532fb4e289ceac882c69537efa3a6d53c;p=platform%2Fupstream%2Fmultipath-tools.git libmultipath: zero out lines in print.c static declaration of line within a function doesn't place them in the bss segment, hence they are not zeroed automatically. Gives funny effects occasionally. Signed-off-by: Hannes Reinecke --- diff --git a/libmultipath/print.c b/libmultipath/print.c index a2253be..986263f 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -1303,6 +1303,7 @@ print_path (struct path * pp, char * style) { char line[MAX_LINE_LEN]; + memset(&line[0], 0, MAX_LINE_LEN); snprint_path(&line[0], MAX_LINE_LEN, style, pp); printf("%s", line); } @@ -1312,6 +1313,7 @@ print_multipath (struct multipath * mpp, char * style) { char line[MAX_LINE_LEN]; + memset(&line[0], 0, MAX_LINE_LEN); snprint_multipath(&line[0], MAX_LINE_LEN, style, mpp); printf("%s", line); } @@ -1321,6 +1323,7 @@ print_pathgroup (struct pathgroup * pgp, char * style) { char line[MAX_LINE_LEN]; + memset(&line[0], 0, MAX_LINE_LEN); snprint_pathgroup(&line[0], MAX_LINE_LEN, style, pgp); printf("%s", line); }