Skip to content
Snippets Groups Projects
Commit c8031e2e authored by Mark Grondona's avatar Mark Grondona
Browse files

o changed xrealloc() to return void * as realloc() does.

parent 16b4c001
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,7 @@ void *_try_xmalloc(size_t size, const char *file, int line, const char *func)
* item (IN/OUT) double-pointer to allocated space
* newsize (IN) requested size
*/
void _xrealloc(void **item, size_t newsize,
void * _xrealloc(void **item, size_t newsize,
const char *file, int line, const char *func)
{
int *p = NULL;
......@@ -142,7 +142,7 @@ void _xrealloc(void **item, size_t newsize,
p[1] = (int)newsize;
*item = &p[2];
return;
return *item;
error:
fprintf(stderr, "%s:%d: %s: xrealloc(%d) failed\n",
......
......@@ -74,7 +74,7 @@
void *_xmalloc(size_t size, const char *file, int line, const char *func);
void *_try_xmalloc(size_t size, const char *file, int line, const char *func);
void _xfree(void **p, const char *file, int line, const char *func);
void _xrealloc(void **p, size_t newsize,
void *_xrealloc(void **p, size_t newsize,
const char *file, int line, const char *func);
int _try_xrealloc(void **p, size_t newsize,
const char *file, int line, const char *func);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment