I'll check it out.
I can usually get the coding that I want quick and easy. The part that hangs me up is the basic stuff like libraries, includes, threads, types, compiling, all the stuff that isn't part of php. Plus php.net provides way better documantation than anything I've found for c. And I'm not very good with oop even in php.
The last day was hell, but I'm feeling pretty good about the rest of it. Most of the remaining I have done before.
I'm going to switch over to N64 for a few days though.
---------- Post added 08-08-2014 at 08:03 PM ---------- Previous post was 08-04-2014 at 09:56 PM ----------
MAME disables "realloc". Defines it as "__error_realloc_is_dangerous__"
How can I rewrite this line so it is not using realloc?
newbuff=realloc(url->buffer,url->buffer_len + (size - rembuff));
It comes from here
libcurl - fopen.c
Thanks.
---------- Post added at 08:47 PM ---------- Previous post was at 08:03 PM ----------
Nevermind. I think I got it.
Code:
void *updateSize(void* p, size_t OldLength, size_t NewLength) {
void *p2 = malloc(NewLength);
if (p && p2) {
memcpy(p2, p, OldLength < NewLength ? OldLength : NewLength);
}
if (p2 || (NewLength == 0)) {
if (p)
free(p); // Note A
}
return p2;
}
newbuff=updateSize(url->buffer,url->buffer_len, url->buffer_len + (size - rembuff));