aboutsummaryrefslogtreecommitdiff
path: root/libbb/get_line_from_file.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-04-01 19:59:37 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-04-01 19:59:37 +0200
commit899ae5337acc2d24edcd64e570adfc5f3c1a8a8a (patch)
tree9ec3de6ffce8df5f82d1428d595ffe4028905a3d /libbb/get_line_from_file.c
parente2afae6303e871a31a061d03359cfcd5dd86c088 (diff)
downloadbusybox-w32-899ae5337acc2d24edcd64e570adfc5f3c1a8a8a.tar.gz
busybox-w32-899ae5337acc2d24edcd64e570adfc5f3c1a8a8a.tar.bz2
busybox-w32-899ae5337acc2d24edcd64e570adfc5f3c1a8a8a.zip
libbb: new function bb_die_memory_exhausted
function old new delta bb_die_memory_exhausted - 10 +10 xstrdup 28 23 -5 xsetenv 27 22 -5 xrealloc 32 27 -5 xputenv 22 17 -5 xmalloc 30 25 -5 xfdopen_helper 40 35 -5 xasprintf 44 39 -5 wget_main 2387 2382 -5 open_socket 54 49 -5 glob_brace 419 414 -5 bb_get_chunk_from_file 146 141 -5 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/11 up/down: 10/-55) Total: -45 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/get_line_from_file.c')
-rw-r--r--libbb/get_line_from_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c
index d10066937..f3d6c6203 100644
--- a/libbb/get_line_from_file.c
+++ b/libbb/get_line_from_file.c
@@ -20,7 +20,7 @@ char* FAST_FUNC bb_get_chunk_from_file(FILE *file, size_t *end)
20 /* grow the line buffer as necessary */ 20 /* grow the line buffer as necessary */
21 if (!(idx & 0xff)) { 21 if (!(idx & 0xff)) {
22 if (idx == ((size_t)-1) - 0xff) 22 if (idx == ((size_t)-1) - 0xff)
23 bb_error_msg_and_die(bb_msg_memory_exhausted); 23 bb_die_memory_exhausted();
24 linebuf = xrealloc(linebuf, idx + 0x100); 24 linebuf = xrealloc(linebuf, idx + 0x100);
25 } 25 }
26 linebuf[idx++] = (char) ch; 26 linebuf[idx++] = (char) ch;