MCPcopy Create free account
hub / github.com/TheOfficialFloW/VitaShell / GetLine

Function GetLine

config.c:36–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static int GetLine(char *buf, int size, char *str) {
37 uint8_t ch = 0;
38 int n = 0;
39 int i = 0;
40 uint8_t *s = (uint8_t *)str;
41
42 while (1) {
43 if (i >= size)
44 break;
45
46 ch = ((uint8_t *)buf)[i];
47
48 if (ch < 0x20 && ch != '\t') {
49 if (n != 0) {
50 i++;
51 break;
52 }
53 } else {
54 *str++ = ch;
55 n++;
56 }
57
58 i++;
59 }
60
61 trim((char *)s);
62
63 return i;
64}
65
66static int getDecimal(const char *str) {
67 return strtol(str, NULL, 0);

Callers 1

readConfigBufferFunction · 0.85

Calls 1

trimFunction · 0.85

Tested by

no test coverage detected