projects
/
oweals
/
opkg-lede.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
treewrite: use Lindent to reformat to kernel coding style
[oweals/opkg-lede.git]
/
libopkg
/
sprintf_alloc.c
diff --git
a/libopkg/sprintf_alloc.c
b/libopkg/sprintf_alloc.c
index aef8e066c3a102f5411e59ec5397beca9424f154..82a847160edd9a6f52097d11c8705df73b2e82d9 100644
(file)
--- a/
libopkg/sprintf_alloc.c
+++ b/
libopkg/sprintf_alloc.c
@@
-18,8
+18,7
@@
#include "sprintf_alloc.h"
#include "libbb/libbb.h"
#include "sprintf_alloc.h"
#include "libbb/libbb.h"
-void
-sprintf_alloc(char **str, const char *fmt, ...)
+void sprintf_alloc(char **str, const char *fmt, ...)
{
va_list ap;
int n;
{
va_list ap;
int n;
@@
-29,13
+28,12
@@
sprintf_alloc(char **str, const char *fmt, ...)
for (;;) {
va_start(ap, fmt);
for (;;) {
va_start(ap, fmt);
- n = vsnprintf
(*str, size, fmt, ap);
+ n = vsnprintf(*str, size, fmt, ap);
va_end(ap);
if (n < 0) {
fprintf(stderr, "%s: encountered an output or encoding"
va_end(ap);
if (n < 0) {
fprintf(stderr, "%s: encountered an output or encoding"
- " error during vsnprintf.\n",
- __FUNCTION__);
+ " error during vsnprintf.\n", __FUNCTION__);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
@@
-43,7
+41,7
@@
sprintf_alloc(char **str, const char *fmt, ...)
break;
/* Truncated, try again with more space. */
break;
/* Truncated, try again with more space. */
- size = n
+
1;
+ size = n
+
1;
*str = xrealloc(*str, size);
}
}
*str = xrealloc(*str, size);
}
}