chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] klibc: strlcpy/strlcat - don't alter destination if size == 0
[elogind.git]
/
klibc
/
klibc
/
vasprintf.c
diff --git
a/klibc/klibc/vasprintf.c
b/klibc/klibc/vasprintf.c
index 5066dbbfaf984622c431034dddc33ffe0bc68420..657bfdc3ef683de6bee1c2b46305e23d91dfc3a5 100644
(file)
--- a/
klibc/klibc/vasprintf.c
+++ b/
klibc/klibc/vasprintf.c
@@
-14,10
+14,10
@@
int vasprintf(char **bufp, const char *format, va_list ap)
va_copy(ap1, ap);
va_copy(ap1, ap);
- bytes = vsnprintf(NULL, 0, format, ap1);
+ bytes = vsnprintf(NULL, 0, format, ap1)
+ 1
;
va_end(ap1);
va_end(ap1);
- *bufp = p = malloc(bytes
+1
);
+ *bufp = p = malloc(bytes);
if ( !p )
return -1;
if ( !p )
return -1;