Fix random_line() cutting off text
fgets() wont include the newline
This commit is contained in:
@ -114,7 +114,6 @@ random_line (char *file_name)
|
|||||||
}
|
}
|
||||||
while (lines > ran);
|
while (lines > ran);
|
||||||
fclose (fh);
|
fclose (fh);
|
||||||
buf[strlen (buf) - 1] = 0; /* remove the trailing '\n' */
|
|
||||||
return strdup (buf);
|
return strdup (buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user