Fix testcase -Wstringop-truncation warning in gcc11

This commit is contained in:
William S Fulton 2021-11-11 23:02:53 +00:00
commit d15a3cb1d4
3 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ class Exc {
public: public:
Exc(int c, const char *m) { Exc(int c, const char *m) {
code = c; code = c;
strncpy(msg,m,256); strncpy(msg,m,255);
} }
int code; int code;
char msg[256]; char msg[256];

View file

@ -10,7 +10,7 @@ class Exc {
public: public:
Exc(int c, const char *m) { Exc(int c, const char *m) {
code = c; code = c;
strncpy(msg,m,256); strncpy(msg,m,255);
} }
int code; int code;
char msg[256]; char msg[256];

View file

@ -10,7 +10,7 @@ class Exc {
public: public:
Exc(int c, const char *m) { Exc(int c, const char *m) {
code = c; code = c;
strncpy(msg,m,256); strncpy(msg,m,255);
} }
int code; int code;
char msg[256]; char msg[256];