From d15a3cb1d4bc537e55aaedb0239559bfd4bf77b2 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 11 Nov 2021 23:02:53 +0000 Subject: [PATCH] Fix testcase -Wstringop-truncation warning in gcc11 --- Examples/javascript/exception/example.h | 2 +- Examples/lua/exception/example.h | 2 +- Examples/python/exception/example.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Examples/javascript/exception/example.h b/Examples/javascript/exception/example.h index bc744cda7..c76c46a5d 100644 --- a/Examples/javascript/exception/example.h +++ b/Examples/javascript/exception/example.h @@ -10,7 +10,7 @@ class Exc { public: Exc(int c, const char *m) { code = c; - strncpy(msg,m,256); + strncpy(msg,m,255); } int code; char msg[256]; diff --git a/Examples/lua/exception/example.h b/Examples/lua/exception/example.h index bc744cda7..c76c46a5d 100644 --- a/Examples/lua/exception/example.h +++ b/Examples/lua/exception/example.h @@ -10,7 +10,7 @@ class Exc { public: Exc(int c, const char *m) { code = c; - strncpy(msg,m,256); + strncpy(msg,m,255); } int code; char msg[256]; diff --git a/Examples/python/exception/example.h b/Examples/python/exception/example.h index bc744cda7..c76c46a5d 100644 --- a/Examples/python/exception/example.h +++ b/Examples/python/exception/example.h @@ -10,7 +10,7 @@ class Exc { public: Exc(int c, const char *m) { code = c; - strncpy(msg,m,256); + strncpy(msg,m,255); } int code; char msg[256];