diff --git a/cpp/_rvmain.cpp b/cpp/_rvmain.cpp index 375bdbd..20795b1 100644 --- a/cpp/_rvmain.cpp +++ b/cpp/_rvmain.cpp @@ -62,7 +62,7 @@ bool is_delim(char c, const char *delims) { // Najprostsza implementacja funkcji strtok char *simple_strtok(char *str, const char *delims) { - static char *static_str = (char *) NULL; // Przechowuje wskaźnik do bieżącej pozycji w ciągu + char *static_str = (char *) NULL; // Przechowuje wskaźnik do bieżącej pozycji w ciągu // Jeśli przekazano nowy ciąg, zaktualizuj static_str if (str == NULL) { @@ -117,7 +117,7 @@ int alg (char * ptr) { int pos = 0; - while (char *token = simple_strtok(ptr, delims)) { + while (char *token = simple_strtok(ptr+strlen(ptr), delims)) { p[pos].ptr = token; //p[pos].len = strlen(token); @@ -152,7 +152,7 @@ int main() { } } */ - alg(str); + int w = alg(str); asm ("nop"); return 1;