summaryrefslogtreecommitdiffstats
path: root/5/6.c
diff options
context:
space:
mode:
Diffstat (limited to '5/6.c')
-rw-r--r--5/6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/5/6.c b/5/6.c
index d33af6c..e151c1c 100644
--- a/5/6.c
+++ b/5/6.c
@@ -20,8 +20,8 @@ int mgetline(char *s, int lim) {
int matoi(char *s) {
int n;
- while (*s >= '0' && *s <= '9')
- n = 10 * n + (*s++ - '0');
+ for (n = 0; *s >= '0' && *s <= '9'; s++)
+ n = 10 * n + (*s - '0');
return n;
} \ No newline at end of file