Skip to content

Commit

Permalink
Changed MADB_CALLOC to follow old ma_malloc(MY_ZEROFILL)) behavior in
Browse files Browse the repository at this point in the history
case of 0 length. Solves many problem comparing to simple calloc
  • Loading branch information
lawrinn committed Oct 27, 2016
1 parent 609489d commit 0c101a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ma_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extern my_bool DummyError;
free((a));\
(a)= NULL;
#define MADB_ALLOC(a) malloc((a))
#define MADB_CALLOC(a) calloc((a), sizeof(char))
#define MADB_CALLOC(a) calloc((a) > 0 ? (a) : 1, sizeof(char))
#define MADB_REALLOC(a,b) realloc((a),(b))

/* If required to free old memory pointed by current ptr, and set new value */
Expand Down

0 comments on commit 0c101a2

Please sign in to comment.