Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/misc/bogosort/files/patch-getlines.c
16461 views
1
--- getlines.c.orig 2002-05-04 20:22:22 UTC
2
+++ getlines.c
3
@@ -49,7 +49,7 @@ getlines(FILE *stream)
4
char **ss = NULL;
5
6
/* read all lines available */
7
- while ((s = getline(stream)) != NULL) {
8
+ while ((s = get_line(stream)) != NULL) {
9
if (numlines == allocated) /* make more room if needed */
10
ss = (char **)xrealloc(ss,
11
(allocated += LINESTEP) * sizeof (char *));
12
@@ -81,7 +81,7 @@ getmorelines(FILE *stream, char **lines)
13
allocated = numlines + 1; /* this is a lie, but it's close enough */
14
15
/* read all lines available */
16
- while ((s = getline(stream)) != NULL) {
17
+ while ((s = get_line(stream)) != NULL) {
18
if (numlines == allocated) /* make more room if needed */
19
ss = (char **)xrealloc(ss,
20
(allocated += LINESTEP) * sizeof (char *));
21
@@ -100,7 +100,7 @@ getmorelines(FILE *stream, char **lines)
22
* line in stream, return NULL on EOF
23
*/
24
char *
25
-getline(FILE *stream)
26
+get_line(FILE *stream)
27
{
28
int c, numchars = 0, allocated = 0;
29
char *s = NULL;
30
31