diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-14 18:30:19 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-14 18:30:19 +0200 |
commit | cb2dc09164a533fc544c59469f6f8bd7d1cc5e04 (patch) | |
tree | b6681a749f382c15f1c84f554961a9c64bd13742 /src/xine-engine/scratch.c | |
parent | a99bea5eb67de57de5aa3259b5b5432d4aaa9c1a (diff) | |
download | xine-lib-cb2dc09164a533fc544c59469f6f8bd7d1cc5e04.tar.gz xine-lib-cb2dc09164a533fc544c59469f6f8bd7d1cc5e04.tar.bz2 |
Use xine_xcalloc instead of xine_xmalloc when mutiplying the number of elements by the size of the single element.
(transplanted from 512894f517c423fed0cadeca0d46c6d909403106)
--HG--
extra : transplant_source : Q%28%94%F5%17%C4%23%FE%D0%CA%DE%CA%0DF%C6%D9%09%401%06
Diffstat (limited to 'src/xine-engine/scratch.c')
-rw-r--r-- | src/xine-engine/scratch.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c index 38b606b84..e4c1dd3e1 100644 --- a/src/xine-engine/scratch.c +++ b/src/xine-engine/scratch.c @@ -109,11 +109,8 @@ scratch_buffer_t *_x_new_scratch_buffer (int num_lines) { this = xine_xmalloc (sizeof (scratch_buffer_t)); - this->lines = xine_xmalloc (sizeof (char *) * (num_lines + 1)); - this->ordered = xine_xmalloc (sizeof (char *) * (num_lines + 1)); - - for (i = 0; i <= num_lines; i++) - this->lines[i] = this->ordered[i] = NULL; + this->lines = xine_xcalloc ((num_lines + 1), sizeof(char*)); + this->ordered = xine_xcalloc ((num_lines + 1), sizeof(char*)); this->scratch_printf = scratch_printf; this->get_content = scratch_get_content; |