projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ab99e2d
)
cs_errmsg never writes to static buffer
author
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 7 Oct 2015 14:06:25 +0000
(16:06 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 7 Oct 2015 14:06:25 +0000
(16:06 +0200)
For the CSYSERR applications should check errno themselves
src/comstack.c
patch
|
blob
|
history
diff --git
a/src/comstack.c
b/src/comstack.c
index
066fafd
..
9d46728
100644
(file)
--- a/
src/comstack.c
+++ b/
src/comstack.c
@@
-35,16
+35,8
@@
static const char *cs_errlist[] =
const char *cs_errmsg(int n)
{
const char *cs_errmsg(int n)
{
- static char buf[250];
-
- if (n < CSNONE || n > CSLASTERROR) {
- sprintf(buf, "unknown comstack error %d", n);
- return buf;
- }
- if (n == CSYSERR) {
- sprintf(buf, "%s: %s", cs_errlist[n], strerror(errno));
- return buf;
- }
+ if (n < CSNONE || n > CSLASTERROR)
+ n = CSNONE;
return cs_errlist[n];
}
return cs_errlist[n];
}