cal: cal_read_block allocate memory
This commit is contained in:
1 parent
f7bad18a56
commit
117d0bb2d0
2 files changed
+11
-4
No files matched your search
+1
-1
@@ -53,7 +53,7 @@ static int root_device = -1;
|
||||
#define min(a, b) (a < b ? a : b)
|
||||
#define local_cal_copy(dest, from, len) strncpy(dest, from, min(len, sizeof(dest)-1))
|
||||
#define local_cal_read(cal, str, ptr, len) ( cal_read_block(cal, str, &ptr, &len, 0) == 0 && ptr )
|
||||
#define local_cal_readcopy(cal, str, dest) do { void * ptr; unsigned long int len; if ( local_cal_read(cal, str, ptr, len) ) local_cal_copy(dest, ptr, len); } while ( 0 )
|
||||
#define local_cal_readcopy(cal, str, dest) do { void * ptr; unsigned long int len; if ( local_cal_read(cal, str, ptr, len) ) { local_cal_copy(dest, ptr, len); free(ptr); } } while ( 0 )
|
||||
|
||||
#if defined(__linux__) && defined(__arm__)
|
||||
|
||||
|
||||
Reference in new issue
Block a user