diff --git a/include/boost/leaf/error.hpp b/include/boost/leaf/error.hpp index d483e2f..66c3165 100644 --- a/include/boost/leaf/error.hpp +++ b/include/boost/leaf/error.hpp @@ -96,7 +96,7 @@ namespace boost { namespace leaf { friend std::ostream & operator<<( std::ostream & os, error const & e ) { char buf[sizeof(e.id_)*CHAR_BIT/4+1]; - int nw = std::sprintf(buf,"%X",e.id_); + int nw = std::snprintf(buf,sizeof(buf),"%X",e.id_); assert(nw>=0); assert(nw