* Fix segfault related to dwarf

This commit is contained in:
Nibble 2010-04-20 19:32:04 +02:00
parent e6e0421ad9
commit 08cfc25e85
2 changed files with 3 additions and 3 deletions

View File

@ -162,7 +162,7 @@ R_API char *r_file_slurp_random_line(const char *file) {
R_API char *r_file_slurp_line(const char *file, int line, int context) {
int i, lines = 0;
int sz;
char *ptr, *str = r_file_slurp (file, &sz);
char *ptr = NULL, *str = r_file_slurp (file, &sz);
// TODO: Implement context
if (str) {
for (i=0;str[i];i++)

View File

@ -97,7 +97,7 @@ R_API char *r_sys_cmd_str_full(const char *cmd, const char *input, int *len, cha
pipe(sh_in);
pipe(sh_out);
pipe(sh_err);
*len = 0;
if (len) *len = 0;
int pid = fork();
if (!pid) {
@ -136,7 +136,7 @@ R_API char *r_sys_cmd_str_full(const char *cmd, const char *input, int *len, cha
break;
if (FD_ISSET (sh_out[0], &rfds)) {
if ((bytes = read (sh_out[0], buffer, sizeof (buffer)-1)) == 0) break;
*len += bytes;
if (len) *len += bytes;
output = r_str_concat (output, buffer);
} else if (FD_ISSET (sh_err[0], &rfds) && sterr) {
if (read (sh_err[0], buffer, sizeof (buffer)-1) == 0) break;