Changeset 1794
- Timestamp:
- Jul 6, 2007, 10:47:51 PM (16 years ago)
- Location:
- zzuf/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/fd.c
r1792 r1794 46 46 /* File descriptor cherry picking */ 47 47 static int *ranges = NULL; 48 static int ranges_static[512];48 static int static_ranges[512]; 49 49 50 50 /* File descriptor stuff. When program is launched, we use the static array of … … 99 99 void _zz_pick(char const *list) 100 100 { 101 /* TODO: free(ranges) if ranges != ranges_static */ 102 ranges = _zz_allocrange(list, ranges_static); 101 ranges = _zz_allocrange(list, static_ranges); 103 102 } 104 103 … … 191 190 if(fds != static_fds) 192 191 free(fds); 192 if(ranges != static_ranges) 193 free(ranges); 193 194 } 194 195 -
zzuf/trunk/src/fuzz.c
r1792 r1794 47 47 /* Per-offset byte protection */ 48 48 static int *ranges = NULL; 49 static int ranges_static[512];49 static int static_ranges[512]; 50 50 51 51 /* Per-value byte protection */ … … 69 69 void _zz_bytes(char const *list) 70 70 { 71 /* TODO: free(ranges) if ranges != ranges_static*/72 ranges = _zz_allocrange(list, ranges_static);71 /* TODO: free(ranges) if ranges != static_ranges */ 72 ranges = _zz_allocrange(list, static_ranges); 73 73 } 74 74 -
zzuf/trunk/src/ranges.c
r1792 r1794 33 33 * understood by cut(1) such as "1-5,8,10-" into a C array for lookup. 34 34 * If more than 256 slots are required, new memory is allocated, otherwise 35 * the static array ranges_staticis used. It is the caller's duty to call36 * free() if the returned value is not ranges_static. */37 int *_zz_allocrange(char const *list, int * ranges_static)35 * the static array static_ranges is used. It is the caller's duty to call 36 * free() if the returned value is not static_ranges. */ 37 int *_zz_allocrange(char const *list, int *static_ranges) 38 38 { 39 39 char const *parser; … … 49 49 ranges = malloc((chunks + 1) * 2 * sizeof(unsigned int)); 50 50 else 51 ranges = ranges_static;51 ranges = static_ranges; 52 52 53 53 /* Fill ranges list */
Note: See TracChangeset
for help on using the changeset viewer.