index
:
135e2/xv6-labs.git
xv6-labs-2024-winter
135e2
log msg
author
committer
range
cow
fs
lock
mmap
net
pgtbl
syscall
thread
traps
util
summary
refs
log
tree
commit
diff
path:
root
/
ulib.c
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
Diffstat
(limited to 'ulib.c')
-rw-r--r--
ulib.c
2
1 files changed, 1 insertions, 1 deletions
diff --git a/ulib.c b/ulib.c
index 5c8e6f3..decab69 100644
--- a/
ulib.c
+++ b/
ulib.c
@@ -67,9 +67,9 @@ gets(char *buf, int max)
cc = read(0, &c, 1);
if(cc < 1)
break;
+ buf[i++] = c;
if(c == '\n' || c == '\r')
break;
- buf[i++] = c;
}
buf[i] = '\0';
return buf;