projects
/
libusual.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60c993a
)
regex: fix off-by-one error in regerror()
author
Marko Kreen
<markokr@gmail.com>
Tue, 13 Dec 2011 09:27:34 +0000
(11:27 +0200)
committer
Marko Kreen
<markokr@gmail.com>
Tue, 13 Dec 2011 09:27:34 +0000
(11:27 +0200)
usual/regex.c
patch
|
blob
|
blame
|
history
diff --git
a/usual/regex.c
b/usual/regex.c
index ee69fe638b7a7e518eda0300805a5430a4c5b8bd..fa51d2938e4e4948891d8881e1264d5ed390f6e3 100644
(file)
--- a/
usual/regex.c
+++ b/
usual/regex.c
@@
-1272,7
+1272,7
@@
size_t regerror(int err, const regex_t *rx, char *dst, size_t dstlen)
"ESUBREG", /* 13 */
};
const char *s = "EUNKNOWN";
- if ((size_t)err <
=
ARRAY_NELEM(errlist))
+ if ((size_t)err < ARRAY_NELEM(errlist))
s = errlist[err];
return snprintf(dst, dstlen, "%s", s);
}