1 // linux specific stuff for shallot
10 // Linux specific stuff (damn this is ugly code. blame linus.)
11 uint8_t parse_cpuinfo(char *buf
, uint16_t avail
, uint16_t *used
) {
14 static uint8_t skip
= 0;
17 if(memcmp(&CPUINFO_PROC_STR
, buf
, CPUINFO_PROC_STR_LEN
) == 0)
21 while((buf
[x
] != 0) && (x
< avail
)) {
23 if(buf
[x
- 1] == '\n') {
33 return 0; // prevent the next if statement from causing a buffer overflow
35 if((x
== avail
) && (buf
[x
- 1] != '\n'))