mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Use correct size in snprintf.
Remove unused buffer. PR: 174631 Submitted by: Henning Petersen MFC after: 1 month
This commit is contained in:
parent
c4d0697685
commit
3496d72c48
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244686
|
@ -87,14 +87,13 @@ errtomsg(int error)
|
|||
{
|
||||
static char ebuf[40];
|
||||
struct errmsg *pe;
|
||||
char buf[MAXPKTSIZE];
|
||||
|
||||
if (error == 0)
|
||||
return ("success");
|
||||
for (pe = errmsgs; pe->e_code >= 0; pe++)
|
||||
if (pe->e_code == error)
|
||||
return (pe->e_msg);
|
||||
snprintf(ebuf, sizeof(buf), "error %d", error);
|
||||
snprintf(ebuf, sizeof(ebuf), "error %d", error);
|
||||
return (ebuf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue