40 lines
452 B
C
40 lines
452 B
C
#include "utils.h"
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
char* getNextArg(char* args)
|
|
{
|
|
uint8_t step = 0;
|
|
int end = 0;
|
|
while (end == 0)
|
|
{
|
|
if (step < 255)
|
|
{
|
|
switch (*(args + step))
|
|
{
|
|
case ';':
|
|
end = 1; // found
|
|
case '\n':
|
|
case '\r':
|
|
case '\0':
|
|
end = 2; // end of line
|
|
}
|
|
}
|
|
else
|
|
{
|
|
end = 3; // line to long
|
|
}
|
|
step++;
|
|
}
|
|
|
|
if (end != 3)
|
|
{
|
|
return args + step;
|
|
}
|
|
else
|
|
{
|
|
return NULL;
|
|
}
|
|
}
|