diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-09-29 16:18:57 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-09-29 16:18:57 +0000 |
commit | 39a841cecf616098c9c8cf63bbfea5ea2922097c (patch) | |
tree | 5b3a1d569d1e952d8c43899050dca4d6c47bf176 /libbb/bb_asprintf.c | |
parent | 6a60c821a81b01a136037f8389bd42d86b37e395 (diff) | |
download | busybox-w32-39a841cecf616098c9c8cf63bbfea5ea2922097c.tar.gz busybox-w32-39a841cecf616098c9c8cf63bbfea5ea2922097c.tar.bz2 busybox-w32-39a841cecf616098c9c8cf63bbfea5ea2922097c.zip |
change interface to bb_xasprintf() - more perfect for me.
ln.c: error_msg(str)->error_msg(%s, str) - remove standart "feature" for hackers
reduce 100 bytes don't care in sum
Diffstat (limited to 'libbb/bb_asprintf.c')
-rw-r--r-- | libbb/bb_asprintf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/bb_asprintf.c b/libbb/bb_asprintf.c index a3ba42454..8658a5408 100644 --- a/libbb/bb_asprintf.c +++ b/libbb/bb_asprintf.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | Copyright (C) 2002 Vladimir Oleynik <dzo@simtreas.ru> | 2 | Copyright (C) 2002,2005 Vladimir Oleynik <dzo@simtreas.ru> |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <stdlib.h> | 5 | #include <stdlib.h> |
@@ -7,16 +7,18 @@ | |||
7 | #include <stdarg.h> | 7 | #include <stdarg.h> |
8 | #include "libbb.h" | 8 | #include "libbb.h" |
9 | 9 | ||
10 | void bb_xasprintf(char **string_ptr, const char *format, ...) | 10 | char *bb_xasprintf(const char *format, ...) |
11 | { | 11 | { |
12 | va_list p; | 12 | va_list p; |
13 | int r; | 13 | int r; |
14 | char *string_ptr; | ||
14 | 15 | ||
15 | va_start(p, format); | 16 | va_start(p, format); |
16 | r = vasprintf(string_ptr, format, p); | 17 | r = vasprintf(&string_ptr, format, p); |
17 | va_end(p); | 18 | va_end(p); |
18 | 19 | ||
19 | if (r < 0) { | 20 | if (r < 0) { |
20 | bb_perror_msg_and_die("bb_xasprintf"); | 21 | bb_perror_msg_and_die("bb_xasprintf"); |
21 | } | 22 | } |
23 | return string_ptr; | ||
22 | } | 24 | } |