Use correct size in snprintf.

Remove unused buffer.

PR:		174631
Submitted by:	Henning Petersen
MFC after:	1 month
This commit is contained in:
Antoine Brodin 2012-12-25 17:06:05 +00:00
parent c4d0697685
commit 3496d72c48
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244686

View file

@ -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);
}