In case you are encountering a calloc error regarding its range, usually cast the given size to anything unsigned, and it should do the trick.