alg need be fixed !!!

This commit is contained in:
mpabi 2024-05-24 16:12:13 +00:00
parent bd1371a214
commit 809f1e4004
1 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ bool is_delim(char c, const char *delims) {
// Najprostsza implementacja funkcji strtok // Najprostsza implementacja funkcji strtok
char *simple_strtok(char *str, const char *delims) { 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 // Jeśli przekazano nowy ciąg, zaktualizuj static_str
if (str == NULL) { if (str == NULL) {
@ -117,7 +117,7 @@ int alg (char * ptr) {
int pos = 0; 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].ptr = token;
//p[pos].len = strlen(token); //p[pos].len = strlen(token);
@ -152,7 +152,7 @@ int main() {
} }
} }
*/ */
alg(str); int w = alg(str);
asm ("nop"); asm ("nop");
return 1; return 1;