git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Introduce x2nrealloc() helper function.
[sliver-openvswitch.git]
/
lib
/
util.c
diff --git
a/lib/util.c
b/lib/util.c
index
72138a0
..
abf005d
100644
(file)
--- a/
lib/util.c
+++ b/
lib/util.c
@@
-118,6
+118,13
@@
xvasprintf(const char *format, va_list args)
return s;
}
+void *
+x2nrealloc(void *p, size_t *n, size_t s)
+{
+ *n = *n == 0 ? 1 : 2 * *n;
+ return xrealloc(p, *n * s);
+}
+
char *
xasprintf(const char *format, ...)
{