gdb tested ;)
This commit is contained in:
parent
fa96a5d3b9
commit
a0f7585ae1
|
@ -131,6 +131,7 @@ int alg(char *ptr) {
|
||||||
|
|
||||||
char *token = simple_strtok(ptr, delims);
|
char *token = simple_strtok(ptr, delims);
|
||||||
while (token != (char *)NULL) {
|
while (token != (char *)NULL) {
|
||||||
|
p[pos].ptr = token;
|
||||||
p[pos].len = strlen(token);
|
p[pos].len = strlen(token);
|
||||||
++pos;
|
++pos;
|
||||||
token = simple_strtok((char *)NULL, delims);
|
token = simple_strtok((char *)NULL, delims);
|
||||||
|
@ -138,7 +139,9 @@ int alg(char *ptr) {
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// gdb: p/x (model[]*)p[0].len
|
||||||
|
// gdb: p/s (char *)(model[]*)p[2].ptr
|
||||||
|
// :) powered by rv32i
|
||||||
int main() {
|
int main() {
|
||||||
char *str = " Success is often defined as the ability to reach your goals in life, whatever those goals may be. In some ways, a better word for success might be attainment, accomplishment, or progress. It is not necessarily a destination but a journey that helps develop the skills and resources you need to thrive.";
|
char *str = " Success is often defined as the ability to reach your goals in life, whatever those goals may be. In some ways, a better word for success might be attainment, accomplishment, or progress. It is not necessarily a destination but a journey that helps develop the skills and resources you need to thrive.";
|
||||||
alg(str);
|
alg(str);
|
||||||
|
|
Loading…
Reference in New Issue