summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--4/12.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/4/12.c b/4/12.c
index f738710..2920826 100644
--- a/4/12.c
+++ b/4/12.c
@@ -7,6 +7,7 @@
void mitoa(int, char[]);
int mgetline(char[], int);
+/* Converts an integer to string using recursion */
int main() {
int n;
char s1[MAXLEN], s2[MAXLEN];
@@ -43,5 +44,5 @@ int mgetline(char s[], int max) {
s[i] = c;
s[i] = 0;
- return c != '\n' && c != EOF ? -1 : i - 1;
+ return c == EOF ? 0 : 1;
}