juju.re/jujure/static/diplodocus/check_loop.c
Julien CLEMENT 3e9261a7c8 fix add diplodocus writeup
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
2022-05-10 00:14:17 +02:00

52 lines
933 B
C

uint64_t check(char* input, int64_t len)
{
...
uint64_t res;
while (cursor < end)
{
char* next = &cursor[1];
if (*(int8_t*)cursor > 4)
{
res = ((uint64_t)(context.err | 1));
break;
}
switch (*(int8_t*)cursor)
{
case 0:
{
...
break;
break;
}
case 1:
{
...
break;
}
case 2:
{
...
break;
}
case 3:
{
...
break;
}
case 4:
{
...
break;
}
}
cursor = next;
}
if ((cursor >= end || (cursor < end && *(int8_t*)cursor <= 4)))
{
res = 1;
}
return res;
}