Sign in
fuchsia
/
third_party
/
wuffs
/
0a8bded7f33dd19f5114f6d46649a647a661a2a1
/
.
/
hello-wuffs-c
/
naive-parse.c
blob: a184739c1bde49f066b9042503942affbb0747c1 [
file
] [
log
] [
blame
]
#include
<stdlib.h>
#include
<inttypes.h>
uint32_t
parse
(
char
*
p
,
size_t
n
)
{
uint32_t
ret
=
0
;
for
(
size_t
i
=
0
;
(
i
<
n
)
&&
p
[
i
];
i
++)
{
ret
=
(
10
*
ret
)
+
(
p
[
i
]
-
'0'
);
}
return
ret
;
}