提交 01cf0a4a 编写于 作者: H Heikki Linnakangas

Fix bogus return value.

'cppcheck' didn't like the return value:

[src/backend/utils/error/elog.c:983]: (error) Returning pointer to local variable 'outbuf' that will be invalid when returning.

The return value was never used, but let's be tidy.
上级 c026c1d7
......@@ -969,7 +969,7 @@ errcode_for_socket_access(void)
* Convert compact error code (ERRCODE_xxx) to 5-char SQLSTATE string,
* and put it into a 6-char buffer provided by caller.
*/
char *
void
errcode_to_sqlstate(int errcode, char outbuf[6])
{
int i;
......@@ -980,7 +980,6 @@ errcode_to_sqlstate(int errcode, char outbuf[6])
errcode >>= 6;
}
outbuf[5] = '\0';
return &outbuf[5];
}
/*
......
......@@ -202,7 +202,7 @@ extern int errcode_for_file_access(void);
extern int errcode_for_socket_access(void);
extern int sqlstate_to_errcode(const char *sqlstate);
extern char *errcode_to_sqlstate(int errcode, char outbuf[6]);
extern void errcode_to_sqlstate(int errcode, char outbuf[6]);
extern int errmsg(const char *fmt,...) pg_attribute_printf(1, 2);
extern int errmsg_internal(const char *fmt,...) pg_attribute_printf(1, 2);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册