From 43e4421368474c6cfbdddab77d49e2debabff62e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 12 Dec 2017 12:52:20 -0500 Subject: [PATCH] fix strncpy not leaving null terminator space --- src/zm_image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_image.cpp b/src/zm_image.cpp index 1c0e5ac41..ebd3164fa 100644 --- a/src/zm_image.cpp +++ b/src/zm_image.cpp @@ -1927,7 +1927,7 @@ void Image::MaskPrivacy( const unsigned char *p_bitmask, const Rgb pixel_colour /* RGB32 compatible: complete */ void Image::Annotate( const char *p_text, const Coord &coord, const unsigned int size, const Rgb fg_colour, const Rgb bg_colour ) { - strncpy( text, p_text, sizeof(text) ); + strncpy( text, p_text, sizeof(text)-1 ); unsigned int index = 0; unsigned int line_no = 0;