From ed92637f252eb5197fd45441d1c044d5eb40d805 Mon Sep 17 00:00:00 2001 From: John Hood Date: Tue, 8 Dec 2015 02:28:05 -0500 Subject: [PATCH] Use snprintf(), not sprintf() Found by OpenBSD build. --- src/terminal/terminalframebuffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terminal/terminalframebuffer.cc b/src/terminal/terminalframebuffer.cc index ae89629..59a7a70 100644 --- a/src/terminal/terminalframebuffer.cc +++ b/src/terminal/terminalframebuffer.cc @@ -600,7 +600,7 @@ std::string Cell::debug_contents( void ) const i < contents.end(); i++ ) { - sprintf( buf, "%s0x%02x", lazycomma, static_cast(*i) ); + snprintf( buf, sizeof buf, "%s0x%02x", lazycomma, static_cast(*i) ); chars.append( buf ); lazycomma = ", "; }