[v1.01] Read file in udev by dynamically reallocating a buffer, instead of allocating a fixed size. Should fix issue #137

This commit is contained in:
Dr-Noob
2022-02-09 22:16:13 +01:00
parent 3046e84b4b
commit c4b2f31320
4 changed files with 22 additions and 4 deletions

View File

@@ -111,3 +111,15 @@ void* ecalloc(size_t nmemb, size_t size) {
return ptr;
}
void* erealloc(void *ptr, size_t size) {
void* newptr = realloc(ptr, size);
if(newptr == NULL) {
printErr("realloc failed: %s", strerror(errno));
exit(1);
}
return newptr;
}