The use of snprintf() to append to a buffer is not valid according to C99

This commit is contained in:
Kevin Lo 2010-12-11 08:07:21 +00:00
parent d970279c91
commit 864187d8a6

View File

@ -162,7 +162,8 @@ ipsec_dump_policy(policy, delimiter)
return NULL;
}
buf = newbuf;
snprintf(buf, buflen, "%s%s%s", buf, delimiter, isrbuf);
snprintf(buf + strlen(buf), buflen - strlen(buf),
"%s%s", delimiter, isrbuf);
off += xisr->sadb_x_ipsecrequest_len;
}