Check errorcode > 0 in regerror().
This commit is contained in:
parent
ab48e8bb73
commit
ccfd31cda2
|
@ -286,6 +286,8 @@ a factor of the size of the compiling workspace (it currently is).
|
|||
|
||||
83. Lock out configuring for EBCDIC with non-8-bit libraries.
|
||||
|
||||
84. Test for error code <= 0 in regerror().
|
||||
|
||||
|
||||
Version 10.20 30-June-2015
|
||||
--------------------------
|
||||
|
|
|
@ -147,7 +147,7 @@ regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
|
|||
int used;
|
||||
const char *message;
|
||||
|
||||
message = (errcode >= (int)(sizeof(pstring)/sizeof(char *)))?
|
||||
message = (errcode <= 0 || errcode >= (int)(sizeof(pstring)/sizeof(char *)))?
|
||||
"unknown error code" : pstring[errcode];
|
||||
|
||||
if (preg != NULL && (int)preg->re_erroffset != -1)
|
||||
|
|
Loading…
Reference in New Issue