mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +01:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user