lib, vtysh: reduce unneccessary C extension usage
We're only supporting GCC, Clang and ICC; but there's no reason to use
nonstandard C constructs if they don't actually provide any benefit.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/lib/buffer.c b/lib/buffer.c
index b689549..ee93101 100644
--- a/lib/buffer.c
+++ b/lib/buffer.c
@@ -148,7 +148,7 @@
{
struct buffer_data *d;
- d = XMALLOC(MTYPE_BUFFER_DATA, offsetof(struct buffer_data, data[b->size]));
+ d = XMALLOC(MTYPE_BUFFER_DATA, offsetof(struct buffer_data, data) + b->size);
d->cp = d->sp = 0;
d->next = NULL;