From: Ivana Hutarova Varekova Date: Mon, 16 Jul 2012 12:54:19 +0000 (+0200) Subject: cgsnapshot: add the end of string character when it is necessary X-Git-Tag: v0.41~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=678bbe4be1115885bf498b12b31a86283642ff78;p=thirdparty%2Flibcgroup.git cgsnapshot: add the end of string character when it is necessary add the end of string character when it is necessary Signed-off-by: Ivana Hutarova Varekova Acked-by: Jan Safranek --- diff --git a/src/tools/cgsnapshot.c b/src/tools/cgsnapshot.c index 51194f67..c1454298 100644 --- a/src/tools/cgsnapshot.c +++ b/src/tools/cgsnapshot.c @@ -729,10 +729,12 @@ int main(int argc, char *argv[]) case 'b': flags |= FL_BLACK; strncpy(bl_file, optarg, FILENAME_MAX); + bl_file[FILENAME_MAX-1] = '\0'; break; case 'w': flags |= FL_WHITE; strncpy(wl_file, optarg, FILENAME_MAX); + wl_file[FILENAME_MAX-1] = '\0'; break; case 't': flags |= FL_STRICT;