1 |
|
/* |
2 |
< |
* i-scream central monitoring system |
2 |
> |
* i-scream libstatgrab |
3 |
|
* http://www.i-scream.org |
4 |
|
* Copyright (C) 2000-2004 i-scream |
5 |
|
* |
27 |
|
|
28 |
|
#include <stdlib.h> |
29 |
|
|
30 |
+ |
#include "tools.h" |
31 |
|
#include "vector.h" |
32 |
|
|
33 |
< |
void *statgrab_vector_resize(void *vector, vector_header *h, int count) { |
33 |
> |
void *sg_vector_resize(void *vector, vector_header *h, int count) { |
34 |
|
int new_count, i; |
35 |
|
|
36 |
|
/* Destroy any now-unused items. |
53 |
|
if (new_count != h->alloc_count) { |
54 |
|
char *new_vector; |
55 |
|
|
56 |
< |
new_vector = realloc(vector, new_count * h->item_size); |
56 |
> |
new_vector = sg_realloc(vector, new_count * h->item_size); |
57 |
|
if (new_vector == NULL && new_count != 0) { |
58 |
|
/* Out of memory -- free the contents of the vector. */ |
59 |
< |
statgrab_vector_resize(vector, h, 0); |
59 |
> |
sg_vector_resize(vector, h, 0); |
60 |
|
h->error = -1; |
61 |
|
return vector; |
62 |
|
} |