Use asprintf instead of snprintf and get rid of #define BYTES_MAX.