* Fix segfault in r_file_slurp_random()
- Thanks elektranox
This commit is contained in:
parent
52c4f25247
commit
4a33771947
2 changed files with 3 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ all:
|
|||
@echo Build done for: ${LIBLIST}
|
||||
|
||||
install:
|
||||
# TODO :Use INSTALL_DATA_DIR instead of mkdir
|
||||
echo Using prefix: ${PFX}
|
||||
# libraries
|
||||
@mkdir -p ${PFX}/lib
|
||||
|
|
|
|||
|
|
@ -117,7 +117,8 @@ char *r_file_slurp_random_line(const char *file)
|
|||
int i, lines = 0;
|
||||
struct timeval tv;
|
||||
int sz;
|
||||
char *ptr, *str = r_file_slurp(file, &sz);
|
||||
char *ptr = NULL;
|
||||
char *str = r_file_slurp(file, &sz);
|
||||
if (str) {
|
||||
gettimeofday(&tv,NULL);
|
||||
srand(getpid()+tv.tv_usec);
|
||||
|
|
|
|||
Loading…
Reference in a new issue